Skip to content

Commit

Permalink
Add Docker image for AIS utilities
Browse files Browse the repository at this point in the history
- Renamed admin to ais-util
- Updated packages and optimized layers

Signed-off-by: Abhishek Gaikwad <[email protected]>
  • Loading branch information
gaikwadabhishek committed Sep 20, 2024
1 parent 4e027cf commit e9827b9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 53 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,49 @@ name: Container Images
on:
workflow_dispatch:
inputs:
build_admin_image:
description: 'Build admin image (aistorage/admin)'
build_util_image:
description: 'Build ais-util image (aistorage/ais-util)'
required: true
type: boolean
default: true
default: false

build_aisnode_image:
description: 'Build aisnode image (aistorage/aisnode)'
required: true
type: boolean
default: true
default: false

build_cluster_minimal_image:
description: 'Build cluster-minimal image (aistorage/cluster-minimal)'
required: true
type: boolean
default: true
default: false

build_ci_image:
description: 'Build GitLab CI image (aistorage/ci)'
required: true
type: boolean
default: true
default: false

build_aisnode_minikube_image:
description: 'Build aisnode-minikube image (aistorage/aisnode-minikube)'
required: true
type: boolean
default: true
default: false

build_authn_image:
description: 'Build AuthN (aistorage/authn)'
required: true
type: boolean
default: true
default: false

image_tag:
description: 'Tag of all the selected images'
required: true
default: 'latest'

env:
ADMIN_IMAGE: 'aistorage/admin'
UTIL_IMAGE: 'aistorage/ais-util'
AISNODE_IMAGE: 'aistorage/aisnode'
CLUSTER_MINIMAL_IMAGE: 'aistorage/cluster-minimal'
CI_IMAGE: 'aistorage/ci'
Expand All @@ -65,11 +65,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push `aisadmin` image
if: ${{ inputs.build_admin_image }}
- name: Build and push `ais-util` image
if: ${{ inputs.build_util_image }}
run: |
pushd $GITHUB_WORKSPACE/deploy/prod/k8s/aisadmin_container
IMAGE_REPO="${{ env.ADMIN_IMAGE }}" IMAGE_TAG="${{ inputs.image_tag }}" make -e all
pushd $GITHUB_WORKSPACE/deploy/prod/k8s/aisutil_container
IMAGE_REPO="${{ env.UTIL_IMAGE }}" IMAGE_TAG="${{ inputs.image_tag }}" make -e all
popd
- name: Build and push `aisnode` image
Expand Down
37 changes: 0 additions & 37 deletions deploy/prod/k8s/aisadmin_container/Dockerfile

This file was deleted.

34 changes: 34 additions & 0 deletions deploy/prod/k8s/aisutil_container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile to build an AIS Util Docker image

FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22 AS builder

WORKDIR /go/src/aistore

RUN git clone --depth 1 https://github.com/NVIDIA/aistore.git

WORKDIR /go/src/aistore/aistore

ARG TARGETOS
ARG TARGETARCH

RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make cli xmeta aisloader

RUN mv cmd/cli/autocomplete /tmp/autocomplete

FROM ubuntu:24.04 as base

RUN apt-get update -yq && \
apt-get install -y wget sysstat curl git iputils-ping make coreutils net-tools iproute2 tcptrack vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Copy over the binaries
COPY --from=builder /go/bin /usr/bin/

# Install autocomplete
COPY --from=builder /tmp/autocomplete /tmp/autocomplete
RUN /tmp/autocomplete/install.sh && \
echo "source /tmp/autocomplete/bash" >> /etc/bash.bashrc

WORKDIR /

CMD ["tail", "-f", "/dev/null"]
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# Usage:
# $ env IMAGE_TAG="3.3" make all
# $ env REGISTRY_URL="docker.io" IMAGE_REPO="aistorage/admin" IMAGE_TAG="4.0" make all
# $ env IMAGE_TAG="v3.3" make all
# $ env REGISTRY_URL="docker.io" IMAGE_REPO="aistorage/ais-util" IMAGE_TAG="v4.0" make all
#

DOCKER ?= docker
REGISTRY_URL ?= docker.io
IMAGE_REPO ?= aistorage/admin
IMAGE_REPO ?= aistorage/ais-util
IMAGE_TAG ?= .must_set_in_environment

.PHONY: all
Expand Down

0 comments on commit e9827b9

Please sign in to comment.