Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt image enhancements #365

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,49 @@ jobs:
include:
- image: docker_open5gs
context: base
file: Dockerfile
- image: docker_kamailio
context: ims_base
file: Dockerfile
- image: docker_srslte
context: srslte
file: Dockerfile
- image: docker_srsran
context: srsran
file: Dockerfile
- image: docker_ueransim
context: ueransim
file: Dockerfile
- image: docker_dns
context: dns
file: Dockerfile
- image: docker_mysql
context: mysql
file: Dockerfile
- image: docker_pyhss
context: pyhss
file: Dockerfile
- image: docker_osmomsc
context: osmomsc
file: Dockerfile
- image: docker_osmohlr
context: osmohlr
file: Dockerfile
- image: docker_metrics
context: metrics
file: Dockerfile
- image: docker_grafana
context: grafana
file: Dockerfile
- image: docker_rtpengine
context: rtpengine
file: Dockerfile
- image: docker_oai_enb
context: oai
file: enb_dockerfile
- image: docker_oai_gnb
context: oai
file: gnb_dockerfile

runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -66,6 +101,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/${{ matrix.file }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,75 @@ RF simulated setups:
- srsRAN (gNB + UE) simulation over ZMQ
- UERANSIM (gNB + UE) simulator

## Building docker images
## Prepare Docker images

* Mandatory requirements:
* [docker-ce](https://docs.docker.com/install/linux/docker-ce/ubuntu) - Version 22.0.5 or above
* [docker compose](https://docs.docker.com/compose) - Version 2.14 or above

You can either pull the pre-built docker images or build them from the source.

### Get Pre-built Docker images

Pull base images:
```
docker pull ghcr.io/herlesupreeth/docker_open5gs:master
docker tag ghcr.io/herlesupreeth/docker_open5gs:master docker_open5gs

docker pull ghcr.io/herlesupreeth/docker_grafana:master
docker tag ghcr.io/herlesupreeth/docker_grafana:master docker_grafana


docker pull ghcr.io/herlesupreeth/docker_metrics:master
docker tag ghcr.io/herlesupreeth/docker_metrics:master docker_metrics
```

You can also pull the pre-built images for additional components

For IMS components:
```
docker pull ghcr.io/herlesupreeth/docker_osmohlr:master
docker tag ghcr.io/herlesupreeth/docker_osmohlr:master docker_osmohlr

docker pull ghcr.io/herlesupreeth/docker_osmomsc:master
docker tag ghcr.io/herlesupreeth/docker_osmomsc:master docker_osmomsc

docker pull ghcr.io/herlesupreeth/docker_pyhss:master
docker tag ghcr.io/herlesupreeth/docker_pyhss:master docker_pyhss

docker pull ghcr.io/herlesupreeth/docker_kamailio:master
docker tag ghcr.io/herlesupreeth/docker_kamailio:master docker_kamailio

docker pull ghcr.io/herlesupreeth/docker_mysql:master
docker tag ghcr.io/herlesupreeth/docker_mysql:master docker_mysql

```

For srsRAN components:
```
docker pull ghcr.io/herlesupreeth/docker_srslte:master
docker tag ghcr.io/herlesupreeth/docker_srslte:master docker_srslte

docker pull ghcr.io/herlesupreeth/docker_srsran:master
docker tag ghcr.io/herlesupreeth/docker_srsran:master docker_srsran
```

For UERANSIM components:
```
docker pull ghcr.io/herlesupreeth/docker_nr-gnb:master
docker tag ghcr.io/herlesupreeth/docker_nr-gnb:master docker_nr-gnb
```

For OAI components:
```
docker pull ghcr.io/herlesupreeth/docker_oai_enb:master
docker tag ghcr.io/herlesupreeth/docker_oai_enb:master docker_oai_enb

docker pull ghcr.io/herlesupreeth/docker_oai_ue:master
docker tag ghcr.io/herlesupreeth/docker_oai_ue:master docker_oai_ue
```

### Build Docker images from source
#### Clone repository and build base docker image of open5gs, kamailio, srsRAN_4G, srsRAN_Project, ueransim

```
Expand Down
26 changes: 10 additions & 16 deletions oai/enb_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,28 @@
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive
ENV BUILD_UHD_FROM_SOURCE=True
ENV UHD_VERSION=4.4.0.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility to not hardcode UHD version??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems no, the build script requires this variable to be set.

4.4 was chosen by various official docker images, see: https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/docker/Dockerfile.base.ubuntu22?ref_type=heads#L34


# Install updates and dependencies
RUN apt-get update && \
apt-get -y install cmake git subversion software-properties-common apt-utils unzip xxd

# Install dependencies to build SoapySDR and Lime Suite
RUN add-apt-repository -y ppa:myriadrf/drivers && \
apt update && \
apt -y install libi2c-dev libusb-1.0-0-dev git g++ cmake libsqlite3-dev libwxgtk3.0-gtk3-dev freeglut3-dev \
python3-distutils gnuplot libfltk1.3-dev liboctave-dev libz-dev

# Install LimeSuite
RUN git clone https://github.com/myriadrf/LimeSuite.git && \
cd LimeSuite && \
git checkout tags/v20.10.0 -b v20.10.0 && \
mkdir builddir && cd builddir && cmake .. && \
make -j`nproc` && make install && ldconfig && \
cd ../udev-rules && sh ./install.sh
apt-get -y install build-essential cmake git subversion software-properties-common apt-utils unzip xxd iproute2

# Install SoapySDR and Lime Suite
RUN apt-get update && \
apt-get -y install limesuite liblimesuite-dev limesuite-udev \
soapysdr-tools soapysdr-module-lms7

# Cloning RAN repository (eNB RAN + UE RAN)
RUN git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git && \
cd openairinterface5g/ && git checkout develop
cd openairinterface5g/ && git checkout v2.1.0

# Set the working directory to openairinterface5g
WORKDIR openairinterface5g

Check warning on line 47 in oai/enb_dockerfile

View workflow job for this annotation

GitHub Actions / build (docker_oai_enb, oai, enb_dockerfile)

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "openairinterface5g" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

RUN . ./oaienv && cd cmake_targets && \
./build_oai -I -w USRP --eNB --verbose-compile


CMD . ./oaienv && /mnt/oai/oai_init.sh && cd cmake_targets/lte_build_oai/build && \

Check warning on line 53 in oai/enb_dockerfile

View workflow job for this annotation

GitHub Actions / build (docker_oai_enb, oai, enb_dockerfile)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
./lte-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -d
28 changes: 11 additions & 17 deletions oai/gnb_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,30 @@
# 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:focal
FROM ubuntu:jammy

ENV DEBIAN_FRONTEND=noninteractive
ENV BUILD_UHD_FROM_SOURCE=True
ENV UHD_VERSION=4.4.0.0

# Install updates and dependencies
RUN apt-get update && \
apt-get -y install cmake git subversion software-properties-common apt-utils unzip xxd
# Install dependencies to build SoapySDR and Lime Suite
RUN add-apt-repository -y ppa:myriadrf/drivers && \
apt update && \
apt -y install libi2c-dev libusb-1.0-0-dev git g++ cmake libsqlite3-dev libwxgtk3.0-gtk3-dev freeglut3-dev \
python3-distutils gnuplot libfltk1.3-dev liboctave-dev libz-dev

# Install LimeSuite
RUN git clone https://github.com/myriadrf/LimeSuite.git && \
cd LimeSuite && \
git checkout tags/v20.10.0 -b v20.10.0 && \
mkdir builddir && cd builddir && cmake .. && \
make -j`nproc` && make install && ldconfig && \
cd ../udev-rules && sh ./install.sh
apt-get -y install build-essential cmake git subversion software-properties-common apt-utils unzip xxd iproute2

# Install SoapySDR and Lime Suite
RUN apt-get update && \
apt-get -y install limesuite liblimesuite-dev limesuite-udev \
soapysdr-tools soapysdr-module-lms7

# Cloning RAN repository (eNB RAN + UE RAN)
RUN git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git && \
cd openairinterface5g/ && git checkout develop
cd openairinterface5g/ && git checkout v2.1.0

# Set the working directory to openairinterface5g
WORKDIR openairinterface5g

Check warning on line 47 in oai/gnb_dockerfile

View workflow job for this annotation

GitHub Actions / build (docker_oai_gnb, oai, gnb_dockerfile)

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "openairinterface5g" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

RUN . ./oaienv && cd cmake_targets && \
./build_oai -I -w USRP --gNB --verbose-compile

CMD . ./oaienv && apt install -y iproute2 && /mnt/oai/oai_init.sh && cd cmake_targets/ran_build/build && \
CMD . ./oaienv && /mnt/oai/oai_init.sh && cd cmake_targets/ran_build/build && \

Check warning on line 52 in oai/gnb_dockerfile

View workflow job for this annotation

GitHub Actions / build (docker_oai_gnb, oai, gnb_dockerfile)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
./nr-softmodem -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.52PRB.usrpb210.conf --sa -d
Loading