Skip to content

Commit

Permalink
ci: update and simplify Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Janusz Marcinkiewicz <[email protected]>
  • Loading branch information
VirrageS committed Aug 8, 2024
1 parent 1f909bf commit 268cfd1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
5 changes: 0 additions & 5 deletions deploy/ci/.dockerignore

This file was deleted.

9 changes: 5 additions & 4 deletions deploy/ci/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
DOCKER ?= docker
REGISTRY_URL ?= docker.io
CI_IMAGE=aistorage/ci
IMAGE_TAG=latest
CI_IMAGE ?= aistorage/ci
IMAGE_TAG ?= latest

all: build push

build:
docker build --network host --no-cache -t $(REGISTRY_URL)/$(CI_IMAGE):$(IMAGE_TAG) -f general.dockerfile .
$(DOCKER) build --network host --no-cache -t $(REGISTRY_URL)/$(CI_IMAGE):$(IMAGE_TAG) -f general.dockerfile .
push:
docker push $(REGISTRY_URL)/$(CI_IMAGE):$(IMAGE_TAG)
$(DOCKER) push $(REGISTRY_URL)/$(CI_IMAGE):$(IMAGE_TAG)
48 changes: 24 additions & 24 deletions deploy/ci/general.dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
FROM golang:1.22

ENV GOPATH="/go"
ENV PATH="${GOPATH}/bin:${PATH}"

RUN apt-get update -yq
RUN apt-get --no-install-recommends -y install curl git sysstat attr build-essential lsof coreutils python3-pip python3-setuptools s3cmd docker.io uuid-runtime bc gettext-base
# Python source-build requirements
RUN apt-get --no-install-recommends -y install wget libbz2-dev libncursesw5-dev unzip libreadline-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libffi-dev zlib1g-dev xz-utils lzma liblzma-dev

# Install Python 3.11 from source
RUN curl -o python3.11.tgz https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz
RUN tar xf python3.11.tgz
RUN (cd Python-3.11.1 && ./configure --enable-optimizations && make -j4 && make install)
RUN pip3 install --upgrade pip
RUN pip3 install awscli black[jupyter]
RUN apt update -yq
RUN apt-get --no-install-recommends -y install curl git sysstat attr build-essential lsof coreutils python3 python3-pip python3-setuptools s3cmd docker.io uuid-runtime bc gettext-base
RUN python3 --version
RUN python3 -m pip config set global.break-system-packages true
RUN pip3 install --upgrade pip && pip3 install awscli black[jupyter]

# Install `kubectl`.
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin/kubectl
RUN kubectl version --client
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl && \
kubectl version --client

# Cache all dependencies and install the linter.
# Install `kind`.
RUN go install sigs.k8s.io/[email protected]

# Cache all dependencies from `aistore` and install the linter.
RUN git clone --depth=1 https://github.com/NVIDIA/aistore.git && cd aistore && \
go mod download && \
cd cmd/cli && go mod download && cd ../.. && \
make lint-update-ci && \
make install-python-deps && \
cd .. && rm -rf aistore
go mod download && \
cd cmd/cli && go mod download && cd ../.. && \
make lint-update-ci && \
make install-python-deps && \
cd .. && rm -rf aistore

# Cache all dependencies from `ais-k8s/operator`.
RUN git clone --depth=1 https://github.com/NVIDIA/ais-k8s.git && cd ais-k8s/operator && \
go mod download && \
make kustomize controller-gen envtest golangci-lint && \
cd ../.. && rm -rf ais-k8s

0 comments on commit 268cfd1

Please sign in to comment.