diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c0d8954..dd6ab47 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -56,25 +56,23 @@ jobs: - image: docker_oai_gnb context: oai file: gnb_dockerfile + - image: docker_eupf + context: eupf + file: Dockerfile runs-on: ubuntu-latest permissions: contents: read packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 - # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -83,16 +81,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image }} - # Build and push Docker image with Buildx (don't push on PR) - # https://github.com/docker/build-push-action - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v6 diff --git a/custom_deployments/with_eupf/.custom_env b/custom_deployments/with_eupf/.custom_env new file mode 100644 index 0000000..7528d67 --- /dev/null +++ b/custom_deployments/with_eupf/.custom_env @@ -0,0 +1,142 @@ +# Set proper timezone to sync times between docker host and containers +#TZ=Europe/Berlin + +MCC=001 +MNC=01 + +TEST_NETWORK=172.22.0.0/24 +DOCKER_HOST_IP=192.168.1.223 + +# MONGODB +MONGO_IP=172.22.0.2 + +# HSS - open5gs +HSS_IP=172.22.0.3 + +# PCRF +PCRF_IP=172.22.0.4 +PCRF_BIND_PORT=3873 + +# SGW +SGWC_IP=172.22.0.5 +SGWU_IP=172.22.0.6 +SGWU_ADVERTISE_IP=172.22.0.6 + +# SMF +SMF_IP=172.22.0.7 +SMF_DNS1=8.8.8.8 +SMF_DNS2=8.8.4.4 + +# UPF +UPF_IP=172.22.0.8 +UPF_ADVERTISE_IP=172.22.0.8 + +# MME +MME_IP=172.22.0.9 + +# AMF +AMF_IP=172.22.0.10 + +# AUSF +AUSF_IP=172.22.0.11 + +# NRF +NRF_IP=172.22.0.12 + +# UDM +UDM_IP=172.22.0.13 + +# UDR +UDR_IP=172.22.0.14 + +# IMS DNS +DNS_IP=172.22.0.15 + +# RTPENGINE +RTPENGINE_IP=172.22.0.16 + +# MYSQL +MYSQL_IP=172.22.0.17 + +# PYHSS +PYHSS_IP=172.22.0.18 +PYHSS_BIND_PORT=3875 + +# ICSCF +ICSCF_IP=172.22.0.19 +ICSCF_BIND_PORT=3869 + +# SCSCF +SCSCF_IP=172.22.0.20 +SCSCF_BIND_PORT=3870 + +# PCSCF +PCSCF_IP=172.22.0.21 +PCSCF_BIND_PORT=3871 + +# SRSLTE ENB +SRS_ENB_IP=172.22.0.22 + +# UERANSIM +NR_GNB_IP=172.22.0.23 +NR_UE_IP=172.22.0.24 + +UE1_IMEI=356938035643803 +UE1_IMEISV=4370816125816151 +UE1_IMSI=001011234567895 +UE1_KI=8baf473f2f8fd09487cccbd7097c6862 +UE1_OP=11111111111111111111111111111111 +UE1_AMF=8000 + +# OAI ENB +OAI_ENB_IP=172.22.0.25 + +# OPEN5GS WEBUI +WEBUI_IP=172.22.0.26 + +# PCF +PCF_IP=172.22.0.27 + +# NSSF +NSSF_IP=172.22.0.28 + +# BSF +BSF_IP=172.22.0.29 + +# ENTITLEMENT SERVER +ENTITLEMENT_SERVER_IP=172.22.0.30 + +# OSMOMSC +OSMOMSC_IP=172.22.0.31 + +# OSMOHLR +OSMOHLR_IP=172.22.0.32 + +# SMSC +SMSC_IP=172.22.0.33 + +# SRSLTE UE +SRS_UE_IP=172.22.0.34 + +# SCP +SCP_IP=172.22.0.35 + +# METRICS +METRICS_IP=172.22.0.36 + +# SRSRAN GNB +SRS_GNB_IP=172.22.0.37 + +# GRAFANA +GRAFANA_IP=172.22.0.39 +GRAFANA_USERNAME=open5gs +GRAFANA_PASSWORD=open5gs + +# UE IPv4 Subnet Range for APN=internet +UE_IPV4_INTERNET=192.168.100.0/24 + +# UE IPv4 Subnet Range for APN=ims +UE_IPV4_IMS=192.168.101.0/24 + +# Maximum Number of UEs +MAX_NUM_UE=1024 diff --git a/custom_deployments/with_eupf/README.md b/custom_deployments/with_eupf/README.md new file mode 100644 index 0000000..b21886b --- /dev/null +++ b/custom_deployments/with_eupf/README.md @@ -0,0 +1,27 @@ +## Deployment description + +This custom deployment uses eUPF (https://github.com/edgecomllc/eupf) rather than open5gs UPF for 5G SA network deployment + +## Additional steps + +Most of the steps to be followed are similar to the steps mentioned in the [README in the root folder](../../README.md). However, additional steps mentioned below must be taken into account while deploying this custom deployment scenario. + +### Build docker images for eUPF + +eUPF docker image needs to be built before deploying + +``` +cd ../../eupf +docker build --no-cache --force-rm -t docker_eupf . +``` + +### Loading environmental variables for custom deployment + +**Warning** +For custom deployments, you must modify/use only the [**.custom_env**](.custom_env) file rather than the [**.env** in the root folder](../../.env). + +``` +set -a +source .custom_env +set +a +``` diff --git a/custom_deployments/with_eupf/sa-deploy.yaml b/custom_deployments/with_eupf/sa-deploy.yaml new file mode 100644 index 0000000..6560c96 --- /dev/null +++ b/custom_deployments/with_eupf/sa-deploy.yaml @@ -0,0 +1,362 @@ +services: + mongo: + image: mongo:6.0 + container_name: mongo + command: --bind_ip 0.0.0.0 + env_file: + - .custom_env + volumes: + - mongodbdata:/data/db + - mongodbdata:/data/configdb + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "27017/udp" + - "27017/tcp" + networks: + default: + ipv4_address: ${MONGO_IP} + webui: + image: docker_open5gs + container_name: webui + depends_on: + - mongo + env_file: + - .custom_env + environment: + - COMPONENT_NAME=webui + volumes: + - ../../webui:/mnt/webui + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "9999/tcp" + ports: + - "9999:9999/tcp" + networks: + default: + ipv4_address: ${WEBUI_IP} + nrf: + image: docker_open5gs + container_name: nrf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=nrf-1 + volumes: + - ../../nrf:/mnt/nrf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${NRF_IP} + scp: + image: docker_open5gs + container_name: scp + env_file: + - .custom_env + environment: + - COMPONENT_NAME=scp-1 + volumes: + - ../../scp:/mnt/scp + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${SCP_IP} + ausf: + image: docker_open5gs + depends_on: + - nrf + - scp + container_name: ausf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=ausf-1 + volumes: + - ../../ausf:/mnt/ausf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${AUSF_IP} + udr: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: udr + env_file: + - .custom_env + environment: + - COMPONENT_NAME=udr-1 + volumes: + - ../../udr:/mnt/udr + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${UDR_IP} + udm: + image: docker_open5gs + depends_on: + - nrf + - scp + container_name: udm + env_file: + - .custom_env + environment: + - COMPONENT_NAME=udm-1 + volumes: + - ../../udm:/mnt/udm + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${UDM_IP} + smf: + image: docker_open5gs + depends_on: + - nrf + - scp + - amf + container_name: smf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=smf-1 + - DEPLOY_MODE=5G + volumes: + - ../../smf:/mnt/smf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "3868/udp" + - "3868/tcp" + - "3868/sctp" + - "5868/udp" + - "5868/tcp" + - "5868/sctp" + - "8805/udp" + - "2123/udp" + - "7777/tcp" + - "9091/tcp" + networks: + default: + ipv4_address: ${SMF_IP} + eupf: + image: docker_eupf + depends_on: + - nrf + - scp + - smf + container_name: eupf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=eupf-1 + volumes: + - ../../eupf:/mnt/eupf + - /sys/fs/bpf:/sys/fs/bpf + - /sys/kernel/debug:/sys/kernel/debug:ro + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "2152/udp" + - "8805/udp" + - "9091/tcp" + - "8181/tcp" + # ports: + # - "2152:2152/udp" + ulimits: + memlock: -1 + cap_add: + - NET_ADMIN + - SYS_ADMIN + privileged: true + sysctls: + - net.ipv4.conf.all.forwarding=1 + #- net.ipv6.conf.all.disable_ipv6=0 + networks: + default: + ipv4_address: ${UPF_IP} + eupf-routes: + image: nicolaka/netshoot + network_mode: host + privileged: true + container_name: eupf-routes + env_file: + - .custom_env + command: + - /bin/sh + - -c + - | + ip ro add ${UE_IPV4_INTERNET} via ${UPF_IP} && \ + iptables -t nat -A POSTROUTING -s ${UE_IPV4_INTERNET} -j MASQUERADE && \ + sysctl -w net.ipv4.conf.all.accept_local=1 + echo "done" + tail -f /dev/null + amf: + image: docker_open5gs + depends_on: + - nrf + - scp + - ausf + - udm + - udr + - pcf + - bsf + container_name: amf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=amf-1 + volumes: + - ../../amf:/mnt/amf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "38412/sctp" + - "7777/tcp" + - "9091/tcp" + # ports: + # - "38412:38412/sctp" + networks: + default: + ipv4_address: ${AMF_IP} + pcf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: pcf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=pcf-1 + volumes: + - ../../pcf:/mnt/pcf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + - "9091/tcp" + networks: + default: + ipv4_address: ${PCF_IP} + bsf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: bsf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=bsf-1 + volumes: + - ../../bsf:/mnt/bsf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${BSF_IP} + nssf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: nssf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=nssf-1 + volumes: + - ../../nssf:/mnt/nssf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${NSSF_IP} + metrics: + build: ./metrics + image: docker_metrics + container_name: metrics + env_file: + - .custom_env + volumes: + - ../../metrics:/mnt/metrics + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "9090/tcp" + ports: + - "9090:9090/tcp" + networks: + default: + ipv4_address: ${METRICS_IP} + grafana: + image: grafana/grafana:11.3.0 + container_name: grafana + env_file: + - .custom_env + volumes: + - grafana_data:/var/lib/grafana + - ../../grafana/:/etc/grafana/provisioning/ + - ../../grafana:/mnt/grafana + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + environment: + - GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME} + - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} + #- GF_INSTALL_PLUGINS=${GRAFANA_INSTALL_PLUGINS} + - GF_PATHS_PROVISIONING=/etc/grafana/provisioning + - GF_PATHS_DATA=/var/lib/grafana + - METRICS_IP=${METRICS_IP} + expose: + - "3000/tcp" + ports: + - "3000:3000/tcp" + networks: + default: + ipv4_address: ${GRAFANA_IP} +networks: + default: + name: docker_open5gs_default + ipam: + config: + - subnet: ${TEST_NETWORK} +volumes: + grafana_data: + name: grafana_data + mongodbdata: + name: docker_open5gs_mongodbdata diff --git a/custom_deployments/with_eupf/sa-vonr-deploy.yaml b/custom_deployments/with_eupf/sa-vonr-deploy.yaml new file mode 100644 index 0000000..50c0712 --- /dev/null +++ b/custom_deployments/with_eupf/sa-vonr-deploy.yaml @@ -0,0 +1,549 @@ +services: + mongo: + image: mongo:6.0 + container_name: mongo + command: --bind_ip 0.0.0.0 + env_file: + - .custom_env + volumes: + - mongodbdata:/data/db + - mongodbdata:/data/configdb + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "27017/udp" + - "27017/tcp" + networks: + default: + ipv4_address: ${MONGO_IP} + webui: + image: docker_open5gs + container_name: webui + depends_on: + - mongo + env_file: + - .custom_env + environment: + - COMPONENT_NAME=webui + volumes: + - ../../webui:/mnt/webui + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "9999/tcp" + ports: + - "9999:9999/tcp" + networks: + default: + ipv4_address: ${WEBUI_IP} + nrf: + image: docker_open5gs + container_name: nrf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=nrf-1 + volumes: + - ../../nrf:/mnt/nrf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${NRF_IP} + scp: + image: docker_open5gs + container_name: scp + env_file: + - .custom_env + environment: + - COMPONENT_NAME=scp-1 + volumes: + - ../../scp:/mnt/scp + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${SCP_IP} + ausf: + image: docker_open5gs + depends_on: + - nrf + - scp + container_name: ausf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=ausf-1 + volumes: + - ../../ausf:/mnt/ausf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${AUSF_IP} + udr: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: udr + env_file: + - .custom_env + environment: + - COMPONENT_NAME=udr-1 + volumes: + - ../../udr:/mnt/udr + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${UDR_IP} + udm: + image: docker_open5gs + depends_on: + - nrf + - scp + container_name: udm + env_file: + - .custom_env + environment: + - COMPONENT_NAME=udm-1 + volumes: + - ../../udm:/mnt/udm + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${UDM_IP} + smf: + image: docker_open5gs + depends_on: + - nrf + - scp + - amf + container_name: smf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=smf-1 + - DEPLOY_MODE=5G + volumes: + - ../../smf:/mnt/smf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "3868/udp" + - "3868/tcp" + - "3868/sctp" + - "5868/udp" + - "5868/tcp" + - "5868/sctp" + - "8805/udp" + - "2123/udp" + - "7777/tcp" + - "9091/tcp" + networks: + default: + ipv4_address: ${SMF_IP} + eupf: + image: docker_eupf + depends_on: + - nrf + - scp + - smf + container_name: eupf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=eupf-1 + volumes: + - ../../eupf:/mnt/eupf + - /sys/fs/bpf:/sys/fs/bpf + - /sys/kernel/debug:/sys/kernel/debug:ro + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "2152/udp" + - "8805/udp" + - "9091/tcp" + - "8181/tcp" + # ports: + # - "2152:2152/udp" + ulimits: + memlock: -1 + cap_add: + - NET_ADMIN + - SYS_ADMIN + privileged: true + sysctls: + - net.ipv4.conf.all.forwarding=1 + #- net.ipv6.conf.all.disable_ipv6=0 + networks: + default: + ipv4_address: ${UPF_IP} + eupf-routes: + image: nicolaka/netshoot + network_mode: host + privileged: true + container_name: eupf-routes + env_file: + - .custom_env + command: + - /bin/sh + - -c + - | + ip ro add ${UE_IPV4_INTERNET} via ${UPF_IP} && \ + iptables -t nat -A POSTROUTING -s ${UE_IPV4_INTERNET} -j MASQUERADE && \ + sysctl -w net.ipv4.conf.all.accept_local=1 + echo "done" + tail -f /dev/null + amf: + image: docker_open5gs + depends_on: + - nrf + - scp + - ausf + - udm + - udr + - pcf + - bsf + container_name: amf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=amf-1 + volumes: + - ../../amf:/mnt/amf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "38412/sctp" + - "7777/tcp" + - "9091/tcp" + # ports: + # - "38412:38412/sctp" + networks: + default: + ipv4_address: ${AMF_IP} + pcf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: pcf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=pcf-1 + volumes: + - ../../pcf:/mnt/pcf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + - "9091/tcp" + networks: + default: + ipv4_address: ${PCF_IP} + bsf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: bsf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=bsf-1 + volumes: + - ../../bsf:/mnt/bsf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${BSF_IP} + nssf: + image: docker_open5gs + depends_on: + - nrf + - scp + - mongo + container_name: nssf + env_file: + - .custom_env + environment: + - COMPONENT_NAME=nssf-1 + volumes: + - ../../nssf:/mnt/nssf + - ../../log:/open5gs/install/var/log/open5gs + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "7777/tcp" + networks: + default: + ipv4_address: ${NSSF_IP} + metrics: + build: ./metrics + image: docker_metrics + container_name: metrics + env_file: + - .custom_env + volumes: + - ../../metrics:/mnt/metrics + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "9090/tcp" + ports: + - "9090:9090/tcp" + networks: + default: + ipv4_address: ${METRICS_IP} + dns: + build: ./dns + image: docker_dns + container_name: dns + env_file: + - .custom_env + volumes: + - ../../dns:/mnt/dns + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "53/udp" + networks: + default: + ipv4_address: ${DNS_IP} + rtpengine: + build: ./rtpengine + image: docker_rtpengine + container_name: rtpengine + privileged: true + env_file: + - .custom_env + volumes: + - ../../rtpengine:/mnt/rtpengine + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + cap_add: + - NET_ADMIN + environment: + - TABLE=0 + - INTERFACE=${RTPENGINE_IP} + - LISTEN_NG=${RTPENGINE_IP}:2223 + - PIDFILE=/run/ngcp-rtpengine-daemon.pid + - PORT_MAX=50000 + - PORT_MIN=49000 + - NO_FALLBACK=no + - TOS=184 + expose: + - "2223/udp" + - "49000-50000/udp" + networks: + default: + ipv4_address: ${RTPENGINE_IP} + mysql: + build: ./mysql + image: docker_mysql + container_name: mysql + env_file: + - .custom_env + volumes: + - dbdata:/var/lib/mysql + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + expose: + - "3306/tcp" + networks: + default: + ipv4_address: ${MYSQL_IP} + pyhss: + build: ./pyhss + image: docker_pyhss + container_name: pyhss + dns: ${DNS_IP} + volumes: + - ../../pyhss:/mnt/pyhss + - ../../pyhss/logs:/pyhss/log/ + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + env_file: + - .custom_env + depends_on: + - dns + - mysql + expose: + - "3868/udp" + - "3868/tcp" + - "8080/tcp" + ports: + - "8080:8080/tcp" + networks: + default: + ipv4_address: ${PYHSS_IP} + icscf: + image: docker_kamailio + container_name: icscf + dns: ${DNS_IP} + volumes: + - ../../icscf:/mnt/icscf + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + env_file: + - .custom_env + environment: + - COMPONENT_NAME=icscf-1 + depends_on: + - dns + - mysql + - pyhss + expose: + - "3869/udp" + - "3869/tcp" + - "4060/udp" + - "4060/tcp" + networks: + default: + ipv4_address: ${ICSCF_IP} + scscf: + image: docker_kamailio + container_name: scscf + dns: ${DNS_IP} + volumes: + - ../../scscf:/mnt/scscf + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + env_file: + - .custom_env + environment: + - COMPONENT_NAME=scscf-1 + depends_on: + - dns + - mysql + - pyhss + expose: + - "3870/udp" + - "3870/tcp" + - "6060/udp" + - "6060/tcp" + networks: + default: + ipv4_address: ${SCSCF_IP} + pcscf: + image: docker_kamailio + container_name: pcscf + dns: ${DNS_IP} + privileged: true + cap_add: + - NET_ADMIN + volumes: + - ../../pcscf:/mnt/pcscf + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + env_file: + - .custom_env + environment: + - COMPONENT_NAME=pcscf-1 + - DEPLOY_MODE=5G + depends_on: + - dns + - mysql + - rtpengine + - icscf + - scscf + expose: + - "3871/udp" + - "3871/tcp" + - "5060/tcp" + - "5060/udp" + - "5100-5120/tcp" + - "5100-5120/udp" + - "6100-6120/tcp" + - "6100-6120/udp" + networks: + default: + ipv4_address: ${PCSCF_IP} + smsc: + image: docker_kamailio + container_name: smsc + dns: ${DNS_IP} + volumes: + - ../../smsc:/mnt/smsc + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + env_file: + - .custom_env + environment: + - COMPONENT_NAME=smsc-1 + depends_on: + - dns + - mysql + expose: + - "7090/udp" + - "7090/tcp" + networks: + default: + ipv4_address: ${SMSC_IP} + grafana: + image: grafana/grafana:11.3.0 + container_name: grafana + env_file: + - .custom_env + volumes: + - grafana_data:/var/lib/grafana + - ../../grafana/:/etc/grafana/provisioning/ + - ../../grafana:/mnt/grafana + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + environment: + - GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME} + - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} + #- GF_INSTALL_PLUGINS=${GRAFANA_INSTALL_PLUGINS} + - GF_PATHS_PROVISIONING=/etc/grafana/provisioning + - GF_PATHS_DATA=/var/lib/grafana + - METRICS_IP=${METRICS_IP} + expose: + - "3000/tcp" + ports: + - "3000:3000/tcp" + networks: + default: + ipv4_address: ${GRAFANA_IP} +networks: + default: + name: docker_open5gs_default + ipam: + config: + - subnet: ${TEST_NETWORK} +volumes: + grafana_data: + name: grafana_data + mongodbdata: + name: docker_open5gs_mongodbdata + dbdata: + name: docker_open5gs_dbdata diff --git a/eupf/Dockerfile b/eupf/Dockerfile new file mode 100644 index 0000000..51598ba --- /dev/null +++ b/eupf/Dockerfile @@ -0,0 +1,55 @@ +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FROM ubuntu:jammy + +ENV DEBIAN_FRONTEND=noninteractive + +# Install updates and dependencies +RUN apt-get update && \ + apt-get -y install wget git clang llvm gcc-multilib libbpf-dev \ + net-tools iputils-ping git ifupdown iperf iptables + +# Install Golang +RUN rm -rf /usr/local/go && wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz && \ + tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz + +ENV PATH="/usr/local/go/bin:${PATH}" + +# Install the Swag command line tool for Golang +RUN go install github.com/swaggo/swag/cmd/swag@v1.8.12 + +# Get eupf, compile and install +RUN export PATH=$(go env GOPATH)/bin:${PATH} && \ + git clone https://github.com/edgecomllc/eupf.git && \ + cd eupf && git checkout tags/v0.6.4 && \ + go generate -v ./cmd/... && \ + go build -v -o bin/eupf ./cmd/ + +# Set the working directory to eupf +WORKDIR eupf + +CMD /mnt/eupf/eupf_init.sh diff --git a/eupf/eupf_init.sh b/eupf/eupf_init.sh new file mode 100755 index 0000000..220bbd6 --- /dev/null +++ b/eupf/eupf_init.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +export PATH="/usr/local/go/bin:${PATH}" +export PATH=$(go env GOPATH)/bin:${PATH} +export IP_ADDR=$(awk 'END{print $1}' /etc/hosts) +export IF_NAME=$(ip r | awk '/default/ { print $5 }') + +exec ./bin/eupf \ + --iface $IF_NAME \ + --aaddr $UPF_IP:8181 \ + --paddr $UPF_IP:8805 \ + --maddr $UPF_IP:9091 \ + --nodeid $UPF_IP \ + --ueip false \ + --ftup false \ + --loglvl info \ + --n3addr $UPF_ADVERTISE_IP $@ + +# Sync docker time +#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone