1- FROM public.ecr.aws/ubuntu/ubuntu:18 .04
1+ FROM public.ecr.aws/ubuntu/ubuntu:22 .04
22
3- # Build time parameters
3+ # Build time parameters
44ARG SERVICE=sagemaker
55
6+ # Python parameters
7+ ARG PYTHON=python3
8+ ARG PYTHON_VERSION=3.12.8
9+ ARG PYTHON_SHORT_VERSION=3.12
10+ # Python won’t try to write .pyc or .pyo files on the import of source modules
11+ # Force stdin, stdout and stderr to be totally unbuffered. Good for logging
12+ ENV PYTHONDONTWRITEBYTECODE=1
13+ ENV PYTHONUNBUFFERED=1
14+ ENV PYTHONIOENCODING=UTF-8
15+
616RUN apt-get update && apt-get install -y curl \
717 wget \
818 git \
9- python3.8 \
10- python3-pip \
11- python3.8-dev \
1219 vim \
1320 sudo \
1421 jq \
15- unzip
22+ unzip \
23+ zlib1g-dev \
24+ cmake \
25+ libssl-dev
26+
27+ # Install python
28+ RUN cd /tmp/ \
29+ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz \
30+ && tar xzf Python-${PYTHON_VERSION}.tgz \
31+ && cd Python-${PYTHON_VERSION} \
32+ && ./configure --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi \
33+ && make -j "$(nproc)" \
34+ && make altinstall \
35+ && cd .. \
36+ && rm -rf Python-${PYTHON_VERSION} \
37+ && rm Python-${PYTHON_VERSION}.tgz \
38+ && ln -s /usr/local/bin/python${PYTHON_SHORT_VERSION} /usr/local/bin/python \
39+ && ln -s /usr/local/bin/python${PYTHON_SHORT_VERSION} /usr/local/bin/python3 \
40+ && rm -f /root/.python_history
41+
42+ # Python Path
43+ ENV PATH="/usr/local/bin:${PATH}"
44+
45+ RUN python -m pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org
46+ RUN pip install --no-cache-dir \
47+ setuptools
1648
1749# Install awscli
18- RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.6.3 .zip" -o "awscliv2.zip" \
50+ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
1951 && unzip -qq awscliv2.zip \
2052 && ./aws/install
2153
@@ -25,26 +57,23 @@ RUN apt-get update && apt install -y software-properties-common \
2557 && apt update && apt install -y yq
2658
2759# Install kubectl
28- RUN curl -LO "https://dl.k8s.io/release/v1.24.0 /bin/linux/amd64/kubectl" \
60+ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt) /bin/linux/amd64/kubectl" \
2961 && chmod +x ./kubectl \
3062 && cp ./kubectl /bin
3163
3264# Install eksctl
3365RUN curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp && mv /tmp/eksctl /bin
3466
35- # Install Helm
36- RUN curl -q -L "https://get.helm.sh/helm-v3.7 .0-linux-amd64.tar.gz" | tar zxf - -C /usr/local/bin/ \
67+ # Install Helm
68+ RUN curl -q -L "https://get.helm.sh/helm-v4.0 .0-linux-amd64.tar.gz" | tar zxf - -C /usr/local/bin/ \
3769 && mv /usr/local/bin/linux-amd64/helm /usr/local/bin/helm \
3870 && rm -r /usr/local/bin/linux-amd64 \
39- && chmod +x /usr/local/bin/helm
71+ && chmod +x /usr/local/bin/helm
4072
4173ENV SERVICE_REPO_PATH=/$SERVICE-controller
4274COPY ./test/e2e/requirements.txt requirements.txt
4375
44- RUN ln -s /usr/bin/python3.8 /usr/bin/python \
45- && python -m pip install --upgrade pip
46-
4776RUN python -m pip install -r requirements.txt
4877
4978WORKDIR /$SERVICE_REPO_PATH
50- CMD ["./test/canary/scripts/run_test.sh"]
79+ CMD ["./test/canary/scripts/run_test.sh"]
0 commit comments