diff --git a/deploy/ci/.dockerignore b/deploy/ci/.dockerignore deleted file mode 100644 index 9bd6b26085..0000000000 --- a/deploy/ci/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -.cache -*.md -docs -go-build -tags diff --git a/deploy/ci/Makefile b/deploy/ci/Makefile index b4196ef1f5..b4c13960fb 100644 --- a/deploy/ci/Makefile +++ b/deploy/ci/Makefile @@ -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) diff --git a/deploy/ci/general.dockerfile b/deploy/ci/general.dockerfile index c5d2399be9..29ada26886 100644 --- a/deploy/ci/general.dockerfile +++ b/deploy/ci/general.dockerfile @@ -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/kind@v0.23.0 + +# 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