blob: cceaea9fb6fe9e0b7243098d749d40048f7f225b [file] [log] [blame]
beierlme7646252022-01-13 10:53:08 -05001#######################################################################################
2# Copyright ETSI Contributors and Others.
Felipe Vicens7334f682020-06-24 15:59:59 +02003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
beierlme7646252022-01-13 10:53:08 -050016#######################################################################################
David Garciaa60ec732021-03-17 15:28:47 +010017
Mark Beierl02feb8e2023-05-10 11:44:11 -040018FROM ubuntu:22.04 as FINAL
David Garciaa60ec732021-03-17 15:28:47 +010019
beierlme7646252022-01-13 10:53:08 -050020ARG APT_PROXY
21RUN if [ ! -z $APT_PROXY ] ; then \
22 echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
23 echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
24 fi
25
David Garciaa60ec732021-03-17 15:28:47 +010026RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
27 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
Mark Beierl02feb8e2023-05-10 11:44:11 -040028 gcc=4:11.* \
29 python3=3.10.* \
30 python3-dev=3.10.* \
31 python3-pip=22.0.* \
32 curl=7.81.* \
33 && rm -rf /var/lib/apt/lists/*
34
35#######################################################################################
garciadeblasbe5864a2023-05-11 15:34:13 +020036# End of common preparation
beierlmd7449362022-01-13 10:53:08 -050037
garciadeblas10285302022-02-10 00:49:51 +010038RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
39 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
aguilard22efe2b2023-11-13 13:11:05 +000040 apt-transport-https \
41 ca-certificates \
garciadeblasbe5864a2023-05-11 15:34:13 +020042 gettext-base=0.21* \
43 git=1:2.34.* \
aguilard22efe2b2023-11-13 13:11:05 +000044 gnupg \
sousaedufd164af2021-08-12 15:35:51 +010045 iputils-ping=3:* \
beierlmd7449362022-01-13 10:53:08 -050046 jq=1.6* \
garciadeblase78f5a72023-05-17 17:53:37 +020047 libmagic1=1:5.*
David Garciaa60ec732021-03-17 15:28:47 +010048
49ARG OSM_TESTS_URL
50ARG PYTHON3_OSM_IM_URL
51ARG PYTHON3_OSMCLIENT_URL
52
53RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
54RUN dpkg -i ./osm_im.deb
55
56RUN curl $PYTHON3_OSMCLIENT_URL -o osmclient.deb
57RUN dpkg -i ./osmclient.deb
58
59RUN curl $OSM_TESTS_URL -o osm_tests.deb
60RUN dpkg -i ./osm_tests.deb
61
David Garciaa60ec732021-03-17 15:28:47 +010062RUN pip3 install \
63 -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
64 -r /usr/lib/python3/dist-packages/osmclient/requirements.txt \
65 -r /usr/share/osm-tests/requirements.txt
66
garciadeblas437867e2024-05-30 14:46:54 +020067# kubectl
68# https://kubernetes.io/releases/
69RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg \
70 && echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list \
71 && apt-get update && apt-get install -y kubectl=1.30.1-1.1
72
73# Google Cloud CLI
aguilard22efe2b2023-11-13 13:11:05 +000074RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
75RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
aguilard32c01952023-11-15 12:34:41 +000076RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
77 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
garciadeblas437867e2024-05-30 14:46:54 +020078 google-cloud-cli=455.*
aguilard22efe2b2023-11-13 13:11:05 +000079
80# Azure CLI
81RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
82
mesajebc1d6e2025-06-30 19:08:29 +020083# Add vCluster CLI
84ENV VCLUSTER_VERSION "v0.26.0"
85RUN curl -L -o /tmp/vcluster "https://github.com/loft-sh/vcluster/releases/download/${VCLUSTER_VERSION}/vcluster-linux-amd64" \
86 && install -c -m 0755 /tmp/vcluster /usr/local/bin \
87 && rm -f /tmp/vcluster
88# Copy vCluster configuration
89COPY configs/vcluster.yaml /etc/vcluster.yaml
90
beierlm14e0ad72021-04-12 16:05:38 -040091RUN mv /usr/share/osm-tests/robot-systest /robot-systest
aguilard22efe2b2023-11-13 13:11:05 +000092RUN mv /usr/share/osm-tests/cloud-scripts /robot-systest/
veleza652d1e32021-10-19 14:43:44 +000093RUN mv /usr/share/osm-tests/conformance-tests/ /robot-systest/
beierlm14e0ad72021-04-12 16:05:38 -040094RUN mv /usr/share/osm-tests/charm.sh /usr/sbin/charm
95
garciadeblasbe5e68c2021-11-24 18:28:51 +010096ARG CACHE_DATE=not_a_date
David Garciaa60ec732021-03-17 15:28:47 +010097RUN git clone \
98 https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git \
99 --recurse-submodules \
100 /robot-systest/osm-packages
101
Felipe Vicens7334f682020-06-24 15:59:59 +0200102WORKDIR /robot-systest
103
Felipe Vicens7334f682020-06-24 15:59:59 +0200104# Folder where Robot tests are stored
105ENV ROBOT_DEVOPS_FOLDER=/robot-systest
106
107# Folder to save alternative DUT environments (optional)
108ENV ENVIRONMENTS_FOLDER=environments
109
110# Folder where all required packages are stored
111ENV PACKAGES_FOLDER=/robot-systest/osm-packages
112
113# Folder where test results should be exported
114ENV ROBOT_REPORT_FOLDER=/robot-systest/results
115
116# Kubeconfig file
117ENV K8S_CREDENTIALS=/root/.kube/config
118
garciadeblas3d4ae9c2025-06-16 12:21:55 +0200119# Kubeconfig file of the existing cluster for Gitops tests
120ENV CLUSTER_KUBECONFIG_CREDENTIALS=/robot-systest/cluster-kubeconfig.yaml
121
garciadeblas2ad64322021-08-13 16:43:15 +0200122# OSM RSA file
123ENV OSM_RSA_FILE=/root/osm_id_rsa
124
Felipe Vicens7334f682020-06-24 15:59:59 +0200125ENV LC_ALL=C.UTF-8
126ENV LANG=C.UTF-8
127
beierlma4a37f72020-06-26 12:55:01 -0400128ENTRYPOINT [ "/robot-systest/run_test.sh"]