Commit eaedfdbb authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Create a dockerfile for public installation

The default `prepareImage.sh` will create an image with cern-only repositories inside. Run `prepareImage.sh public` to use another dockerfile, that forces package installation from public sources.
parent 40f474fc
#!/bin/bash -e
PUBLIC=false
if [[ $1 == "public" ]]; then
PUBLIC=true
echo Going to install from public repositories
fi
echo Creating the docker image...
./prepareImageStage1-rpms.sh
if [[ "$PUBLIC" == false ]] ; then
./prepareImageStage1-rpms.sh
else
./prepareImageStage1-rpms-public.sh
fi
./prepareImageStage2-eos.sh
./prepareImageStage3-scripts.sh
./prepareImageStage2b-scripts.sh
\ No newline at end of file
./prepareImageStage2b-scripts.sh
#!/bin/bash -e
(cd ~/CTA; sudo docker build . -f continuousintegration/docker/ctafrontend/cc7/buildtree-stage1-rpms-public/Dockerfile -t buildtree-runner-stage1)
......@@ -29,31 +29,12 @@ mkdir -p ~/CTA-build-srpm
echo Installing repos
if [[ "$PUBLIC" == false ]] ; then
for r in `ls -1 ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/*.repo` ; do
sudo yum-config-manager --add-repo=$r
done
sudo yum-config-manager --add-repo=`ls -1 ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/*.repo`
else
sudo wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
sudo tee /etc/yum.repos.d/oracle-instant-client.repo > /dev/null << 'EOF'
[oracle-instant-client]
name=Oracle instant client
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
sudo wget https://git.ceph.com/release.asc -O /etc/pki/rpm-gpg/RPM-ASC-KEY-ceph
sudo tee /etc/yum.repos.d/ceph.repo > /dev/null << 'EOF'
[ceph]
name=Ceph
baseurl=https://download.ceph.com/rpm-nautilus/el7/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-ASC-KEY-ceph
gpgcheck=1
enabled=1
EOF
sudo yum-config-manager --add-repo=`ls -1 ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/eos-*.repo`
sudo yum-config-manager --add-repo=`ls -1 ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d-public/*.repo`
fi
sudo yum install -y yum-plugin-priorities
......
# ******************************************************************************
#
# The CERN Tape Archive (CTA) project
# Copyright (C) 2015 CERN
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ****************************************************************************/
# CTA generic image for system tests
# FROM must be the first command in Dockerfile!!
FROM gitlab-registry.cern.ch/linuxsupport/cc7-base
# my environment variables
ENV ORCHESTRATIONDIR="continuousintegration/orchestration/pods" \
LOCALORCHESTRATIONDIR="/opt/ci" \
BASEDIR="continuousintegration/docker/ctafrontend/cc7" \
CTAREPODIR="/tmp/repo"
# yum update could be added at some point.
RUN yum install -y \
wget \
&& \
yum clean all
# Add repos for CTA dependencies
ADD ${BASEDIR}/etc/logrotate.d /etc/logrotate.d
ADD ${BASEDIR}/etc/yum /etc/yum
ADD ${BASEDIR}/etc/yum.repos.d-public /etc/yum.repos.d
RUN wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
RUN wget https://git.ceph.com/release.asc -O /etc/pki/rpm-gpg/RPM-ASC-KEY-ceph
RUN yum install -y \
yum-plugin-downloadonly \
yum-plugin-priorities \
yum-plugin-versionlock \
createrepo epel-release \
&& \
yum clean all
# where do we want to get xroot from?
# epel version is more recent but eos-citrine-depend repo has a higher priority (4) than epel
# => need to set epel prio to 4: yum-config-manager --setopt="epel.priority=4"
# or if taking the older version from eos, eos-citrine-depend must be enabled so that
# the older version of xroot is installed by cta-cli and is not conflicting later when installing eos...
# Newer version of CTA requires xroot >= 4.4.1-1...
# therefore set epel priority to 4...
# Create local repo for cta artifacts and to cache RPMs locally
# Populate local repository and enable it, then install any rpm that is needed for
# any container. Finally add needed directories.
RUN yum-config-manager --enable epel --setopt="epel.priority=4" \
&& \
yum install -y\
xrootd \
xrootd-client \
xrootd-debuginfo \
xrootd-server \
sudo \
logrotate \
oracle-instantclient19.3-basic \
oracle-instantclient19.3-meta \
oracle-instantclient19.3-sqlplus \
cgdb \
less \
psmisc \
lynx \
strace \
ltrace \
heimdal-server \
heimdal-workstation \
ceph-common \
mt-st \
mtx \
lsscsi \
sg3_utils \
protobuf3 \
cryptopp \
json-c \
shadow-utils \
sudo \
zeromq \
mariadb-devel \
postgresql-libs \
gtest \
jemalloc \
eos-folly \
hiredis \
jsoncpp \
libmicrohttpd \
jq \
python36 \
&& \
yum clean all \
&& \
rm -rf /var/cache/yum \
&& \
mkdir -pv /etc/cta
# Mark the image as a buildtree image
RUN touch /etc/buildtreeRunner
# Docker image run setup
ADD ${BASEDIR}/run.sh /
ENTRYPOINT ["/run.sh"]
[ceph]
name=Ceph
baseurl=https://download.ceph.com/rpm-nautilus/el7/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-ASC-KEY-ceph
gpgcheck=1
enabled=1
[eos-citrine-depend]
name=EOS Citrine depend
baseurl=http://storage-ci.web.cern.ch/storage-ci/eos/citrine-depend/el-7/x86_64/
priority=4
gpgcheck=0
enabled=1
[eos-citrine]
name=EOS Citrine
baseurl=https://storage-ci.web.cern.ch/storage-ci/eos/citrine/tag/testing/el-7/x86_64/
priority=4
gpgcheck=0
enabled=1
[eos-quarkdb]
name=EOS QuarkDB Repository
baseurl=http://storage-ci.web.cern.ch/storage-ci/quarkdb/tag/el7/x86_64/
gpgcheck=0
enabled=0
priority=5
[oracle-instant-client]
name=Oracle instant client
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment