forked from kubeflow/hub
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile.testops
More file actions
57 lines (45 loc) · 1.77 KB
/
Dockerfile.testops
File metadata and controls
57 lines (45 loc) · 1.77 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
FROM registry.access.redhat.com/ubi9/python-312
ARG TARGETARCH
# Switch to root to install packages and create user
USER 0
# Install skopeo
RUN dnf update -y && \
dnf install -y skopeo && \
dnf clean all
# Create odh user
RUN useradd -m -s /bin/bash odh
# Set working directory
WORKDIR /home/odh
# Copy project files
COPY clients/python clients/python
COPY catalog/clients/python catalog/clients/python
COPY jobs/async-upload jobs/async-upload
COPY api/ api/
COPY manifests/ manifests/
COPY scripts/ scripts/
# Download kubectl binary
RUN ARCH="${TARGETARCH:-amd64}" && \
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt) && \
curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" && \
curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl.sha256" && \
echo "$(<kubectl.sha256) kubectl" | sha256sum -c - && \
install -m 0755 kubectl /usr/local/bin/ && rm -f kubectl kubectl.sha256
# Give write permissions to all copied folders and change ownership to odh user
RUN chown -R odh:odh /home/odh && \
chmod -R 755 api/ manifests/ scripts/
# Install poetry and pytest (as root, into the app-root virtualenv)
RUN pip install --no-cache-dir poetry pytest
RUN chown -R odh:odh /opt/app-root/src/
# Disable the base image's auto-activation of /opt/app-root virtualenv so
# Poetry creates its own in-project .venv instead of installing into root-owned dirs
ENV VIRTUAL_ENV="" \
BASH_ENV="" \
ENV="" \
PROMPT_COMMAND="" \
POETRY_VIRTUALENVS_IN_PROJECT=true
# Switch to odh user
USER odh
ENV PATH="/home/odh/.local/bin:$PATH"
# Set entrypoint to make command
ENTRYPOINT ["make", "-C", "clients/python"]
CMD ["deploy-mr-odh", "deploy-local-registry", "deploy-test-minio", "test-e2e-odh"]