-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContainerfile
More file actions
121 lines (95 loc) · 3.73 KB
/
Containerfile
File metadata and controls
121 lines (95 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
ARG PYTHON_VERSION=3.13.3
ARG ALPINE_VERSION=3.21
ARG IMAGE=registry.osism.cloud/dockerhub/python
FROM ${IMAGE}:${PYTHON_VERSION}-alpine${ALPINE_VERSION}
ENV PYTHONWARNINGS="ignore::UserWarning"
COPY . /src
COPY --from=ghcr.io/astral-sh/uv:0.10.8 /uv /usr/local/bin/uv
COPY files/data /data
COPY files/change.sh /change.sh
COPY files/run-ansible-console.sh /run-ansible-console.sh
COPY requirements.yml /ansible/requirements.yml
ENV CLUSTERSHELL_CFGDIR=/etc/clustershell/
COPY files/clustershell/clush.conf /etc/clustershell/clush.conf
COPY files/clustershell/groups.conf /etc/clustershell/groups.conf
COPY files/sonic/port_config/ /etc/sonic/port_config/
COPY files/sonic/yang_models/ /etc/sonic/yang_models/
COPY files/sonic/config_db.json /etc/sonic/config_db.json
COPY files/netbox-manager/settings.toml /usr/local/config/settings.toml
COPY files/redfishMockupCreate.py /
RUN apk add --no-cache bash
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN <<EOF
set -e
set -x
# install required packages
apk add --no-cache --virtual .build-deps \
build-base \
gcc \
linux-headers \
musl-dev \
openldap-dev
apk add --no-cache \
cdrkit \
coreutils \
git \
less \
libyang \
openssh-client \
procps \
skopeo \
tini
# install python packages
uv pip install --no-cache --system -r /src/requirements.txt
uv pip install --no-cache --system -r /src/requirements.ansible.txt
uv pip install --no-cache --system -r /src/requirements.openstack-image-manager.txt
uv pip install --no-cache --system -r /src/requirements.openstack-flavor-manager.txt
uv pip install --no-cache --system -r /src/requirements.netbox-manager.txt
# install python-osism
uv pip install --no-cache --system /src
# install ansible collections
mkdir -p /ansible/logs
ansible-galaxy collection install -v -f -r /ansible/requirements.yml -p /usr/share/ansible/collections
ansible-galaxy collection install -v -f -r /usr/local/lib/python*/site-packages/netbox_manager/requirements.yml -p /usr/share/ansible/collections
ln -s /usr/share/ansible/collections /ansible/collections
# copy image definitions for the openstack-image-manager
git clone --depth 1 https://github.com/osism/openstack-image-manager.git /openstack-image-manager
mkdir -p /etc/images
ln -s /opt/configuration/environments/openstack /etc/openstack
cp /openstack-image-manager/etc/images/* /etc/images
rm -rf /openstack-image-manager
# install openstack-project-manager
git clone --depth 1 https://github.com/osism/openstack-project-manager.git /openstack-project-manager
uv pip install --no-cache --system -r /openstack-project-manager/requirements.txt
rm -rf /openstack-project-manager/.git
# install openstack-simple-stress
git clone --depth 1 https://github.com/osism/openstack-simple-stress.git /openstack-simple-stress
uv pip install --no-cache --system -r /openstack-simple-stress/requirements.txt
rm -rf /osism/openstack-simple-stress/.git
# install openstack-resource-manager
git clone --depth 1 https://github.com/osism/openstack-resource-manager.git /openstack-resource-manager
rm -rf /openstack-resource-manager/.git
# add tests
git clone --depth 1 https://github.com/osism/tests.git /tests
rm -rf /tests/.git
# install SCS compliance check tests (only Tests/ directory)
git clone --depth 1 https://github.com/SovereignCloudStack/standards.git /tmp/scs-standards
cp -r /tmp/scs-standards/Tests /scs-tests
rm -rf /tmp/scs-standards
# prepare use of clustershell
ln -s /ansible/inventory/clustershell /etc/clustershell/groups.d
# create /etc/sonic/export directory
mkdir -p /etc/sonic/export
# cleanup
apk del .build-deps
rm -rf \
/src \
/tmp/* \
/usr/share/doc/* \
/usr/share/man/* \
/var/tmp/*
uv pip install --no-cache --system pyclean==3.0.0
pyclean /usr
uv pip uninstall --system pyclean
EOF
ENTRYPOINT ["/sbin/tini", "--"]