Skip to content

Commit

Permalink
[#48/#22] task: Enable build caching / use OSSO repos where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic-builder OSSO committed Nov 22, 2024
1 parent a736914 commit 655a3a0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dockers/docker-base-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"]
COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"]
COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"]

# APT caching (debian.sources)
RUN sed -i -e "s/deb.debian.org/apt.osso.nl/g" $(find /etc/apt/sources.list /etc/apt/sources.list.d -type f)

# Update apt cache and
# pre-install fundamental packages
RUN apt update && \
Expand Down Expand Up @@ -65,6 +68,8 @@ RUN apt update && \

# Add a config file to allow pip to install packages outside of apt/the Debian repos
COPY ["pip.conf", "/etc/pip.conf"]
# Use custom mirror
RUN pip3 config --global set global.index-url https://pypi.osso.nl/simple

# Upgrade pip via PyPI and uninstall the Debian version
RUN pip3 install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-base-bookworm/pip.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[global]
break-system-packages = true
index-url = https://pypi.osso.nl/simple
1 change: 1 addition & 0 deletions files/image_config/pip/pip.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[global]
break-system-packages = true
index-url = https://pypi.osso.nl/simple
2 changes: 1 addition & 1 deletion rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ INCLUDE_MUX = y
ENABLE_ASAN ?= n

# reset default container registry from dockerhub to other
DEFAULT_CONTAINER_REGISTRY ?=
DEFAULT_CONTAINER_REGISTRY ?= harbor.osso.io/docker-readonly

# INCLUDE_BOOTCHART - install systemd-bootchart
INCLUDE_BOOTCHART = y
Expand Down
1 change: 1 addition & 0 deletions scripts/prepare_docker_buildinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ARG SONIC_VERSION_CACHE
ARG SONIC_VERSION_CONTROL_COMPONENTS
COPY ["buildinfo", "/usr/local/share/buildinfo"]
COPY vcache/ /sonic/target/vcache/'${IMAGENAME}'
RUN sed -i -e "s/debian-archive.trafficmanager.net/apt.osso.nl/g" $(find /etc/apt/sources.list /etc/apt/sources.list.d -type f)
RUN dpkg -i /usr/local/share/buildinfo/sonic-build-hooks_1.0_all.deb
ENV IMAGENAME='${IMAGENAME}'
ENV DISTRO='${DISTRO}'
Expand Down
1 change: 1 addition & 0 deletions sonic-slave-bookworm/pip.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[global]
break-system-packages = true
index-url = https://pypi.osso.nl/simple

0 comments on commit 655a3a0

Please sign in to comment.