From 7a5ceab2e2288725abf0ed4897369e8e6bc88a79 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Wed, 4 Nov 2020 14:34:36 -0800 Subject: [PATCH] Add local file repo Signed-off-by: James Ketrenos --- templates/rhel/20-local-file-intel-repo.in | 53 ++++++++++++++++++++++ templates/sles/20-local-file-intel-repo.in | 45 ++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100755 templates/rhel/20-local-file-intel-repo.in create mode 100755 templates/sles/20-local-file-intel-repo.in diff --git a/templates/rhel/20-local-file-intel-repo.in b/templates/rhel/20-local-file-intel-repo.in new file mode 100755 index 0000000..48bffdc --- /dev/null +++ b/templates/rhel/20-local-file-intel-repo.in @@ -0,0 +1,53 @@ +# Update and install curl, tar, createrepo-c, and gzip as +# they aren't in the base OS image and are needed +# for creating a local filesystem repo +# +# Adapted from https://agama.jf.intel.com/drivers/dg1/suse/local + +# Prerequisites +# +RUN dnf install -y \ + curl \ + tar \ + createrepo_c \ + gzip + +# Make /repos/${BUILD} directory +# +WORKDIR /repos/${BUILD} + +# Download ${BUILD} artifacts +# +# ARTIFACTORY_PATH is set by scripts/build-dockerfile.sh based on the value of +# BUILD. For example, agama-ci-releases_20.4 becomes agama-ci-releases/20.4 +# +# sh (the shell interpreter of Docker) does not support subsitution so +# this can't be done within the Dockerfile itself. +# +# Since we're already making special variables, scripts/build-dockerfile.sh +# will also set ARTIFACTORY_RELEASE based on the OS_RELEASE name if Ubuntu +# is being used (eg., 20.04 for focal, etc) +# +RUN curl -s --noproxy '*' -L \ + https://gfx-assets-build.fm.intel.com/artifactory/api/archive/download/agama-builds/ci/${ARTIFACTORY_PATH}/${BUILD}/artifacts/linux/${OS_DISTRO}/${ARTIFACTORY_RELEASE}?archiveType=tgz \ + | tar -xvz --warning=no-timestamp + +# Eventually the repodata should be part of the artifacts; +# Currently, however, the published repodata has invalid +# sha256 sums for the RPMs +RUN rm -rf /repos/${BUILD}/repodata + +# Turn /repos/${BUILD} into a local package repository +# +RUN createrepo /repos/${BUILD} + +# Add the local package repository to the system +RUN { \ + echo "[intel-graphics-local]" ; \ + echo "name=intel-graphics-local" ; \ + echo "baseurl=file:///repos/${BUILD}" ; \ + echo "enabled=1" ; \ + echo "gpgcheck=0" ; \ +} > /etc/yum.repos.d/intel-graphics-local.repo + + diff --git a/templates/sles/20-local-file-intel-repo.in b/templates/sles/20-local-file-intel-repo.in new file mode 100755 index 0000000..9432742 --- /dev/null +++ b/templates/sles/20-local-file-intel-repo.in @@ -0,0 +1,45 @@ +# Update and install curl, tar, createrepo-c, and gzip as +# they aren't in the base OS image and are needed +# for creating a local filesystem repo +# +# Adapted from https://agama.jf.intel.com/drivers/dg1/suse/local + +# Prerequisites +# +RUN zypper install -y \ + curl \ + tar \ + createrepo_c \ + gzip + +# Make /repos/${BUILD} directory +# +WORKDIR /repos/${BUILD} + +# Download ${BUILD} artifacts +# +# ARTIFACTORY_PATH is set by scripts/build-dockerfile.sh based on the value of +# BUILD. For example, agama-ci-releases_20.4 becomes agama-ci-releases/20.4 +# +# sh (the shell interpreter of Docker) does not support subsitution so +# this can't be done within the Dockerfile itself. +# +# Since we're already making special variables, scripts/build-dockerfile.sh +# will also set ARTIFACTORY_RELEASE based on the OS_RELEASE name if Ubuntu +# is being used (eg., 20.04 for focal, etc) +# +RUN curl -s --noproxy '*' -L \ + https://gfx-assets-build.fm.intel.com/artifactory/api/archive/download/agama-builds/ci/${ARTIFACTORY_PATH}/${BUILD}/artifacts/linux/${OS_DISTRO}/${ARTIFACTORY_RELEASE}?archiveType=tgz \ + | tar -xvz --warning=no-timestamp + +# Eventually the repodata should be part of the artifacts; +# Currently, however, the published repodata has invalid +# sha256 sums for the RPMs +RUN rm -rf /repos/${BUILD}/repodata + +# Turn /repos/${BUILD} into a local package repository +# +RUN createrepo /repos/${BUILD} + +# Add the local package repository to the system +RUN zypper addrepo -G -e -f /repos/${BUILD} ${BUILD}