Skip to content

Commit

Permalink
Added helm registry in sandbox (flyteorg#1846)
Browse files Browse the repository at this point in the history
* Added helm registry in sandbox

Signed-off-by: Yuvraj <[email protected]>

* Added build arg in workflow

Signed-off-by: Yuvraj <[email protected]>

* fix typo

Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia authored Nov 24, 2021
1 parent 41e08db commit a9e06ae
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Set flyte version to release
id: set_version
run: |
if [ ${{ github.event_name}} = "release" ]; then
echo ::set-output name=flyte_version::$(echo ${{ github.event.release.tag_name }})
else
echo ::set-output name=flyte_version::latest
fi
- name: Prepare sandbox Image Names
id: sandbox-names
uses: docker/metadata-action@v3
Expand Down Expand Up @@ -59,6 +67,7 @@ jobs:
platforms: linux/arm64, linux/amd64
push: ${{ github.event_name == 'release' }}
target: default
build-args: "FLYTE_VERSION=${{ steps.set_version.outputs.flyte_version }}"
tags: ${{ steps.sandbox-names.outputs.tags }}
file: docker/sandbox/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -71,6 +80,7 @@ jobs:
push: ${{ github.event_name == 'release' }}
target: dind
tags: ${{ steps.dind-names.outputs.tags }}
build-args: "FLYTE_VERSION=${{ steps.set_version.outputs.flyte_version }}"
file: docker/sandbox/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
Expand Down
10 changes: 8 additions & 2 deletions docker/sandbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ COPY docker/sandbox/kubectl docker/sandbox/cgroup-v2-hack.sh docker/sandbox/wait
FROM base_ AS default

# Install dependencies
RUN apk add --no-cache bash git make tini
RUN apk add --no-cache bash git make tini curl jq

# Copy entrypoints
COPY docker/sandbox/flyte-entrypoint-default.sh /flyteorg/bin/flyte-entrypoint.sh
COPY docker/sandbox/bashrc /root/.bashrc

ARG FLYTE_VERSION="latest"
ENV FLYTE_VERSION "${FLYTE_VERSION}"

# Update PATH variable
ENV PATH "/flyteorg/bin:${PATH}"

Expand All @@ -83,14 +86,17 @@ ENTRYPOINT ["tini", "flyte-entrypoint.sh"]
FROM docker:20.10.8-dind AS dind

# Install dependencies
RUN apk add --no-cache bash git make tini
RUN apk add --no-cache bash git make tini curl jq

# Copy artifacts from base
COPY --from=base_ /flyteorg/ /flyteorg/

# Copy entrypoints
COPY docker/sandbox/flyte-entrypoint-dind.sh /flyteorg/bin/flyte-entrypoint.sh

ARG FLYTE_VERSION="latest"
ENV FLYTE_VERSION "${FLYTE_VERSION}"

# Update PATH variable
ENV PATH "/flyteorg/bin:${PATH}"

Expand Down
12 changes: 10 additions & 2 deletions docker/sandbox/flyte-entrypoint-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ K3S_PID=$!
timeout 600 sh -c "until k3s kubectl explain deployment &> /dev/null; do sleep 1; done" || ( echo >&2 "Timed out while waiting for the Kubernetes cluster to start"; exit 1 )
echo "Done."

FLYTE_VERSION=${FLYTE_VERSION:-latest}
if [[ $FLYTE_VERSION = "latest" ]]
then
FLYTE_VERSION=$(curl --silent "https://api.github.com/repos/flyteorg/flyte/releases/latest" | jq -r .tag_name)
fi

# Deploy flyte
echo "Deploying Flyte..."
helm dep update /flyteorg/share/flyte/
helm upgrade -n flyte -f /flyteorg/share/flyte/values-sandbox.yaml --create-namespace flyte /flyteorg/share/flyte --kubeconfig /etc/rancher/k3s/k3s.yaml --install
helm repo add flyteorg https://flyteorg.github.io/flyte
helm repo update
helm fetch flyteorg/flyte --version=$FLYTE_VERSION
helm upgrade -n flyte -f /flyteorg/share/flyte/values-sandbox.yaml --create-namespace flyte flyteorg/flyte --kubeconfig /etc/rancher/k3s/k3s.yaml --install --version $FLYTE_VERSION

wait-for-flyte.sh

Expand Down
12 changes: 10 additions & 2 deletions docker/sandbox/flyte-entrypoint-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ K3S_PID=$!
timeout 600 sh -c "until k3s kubectl explain deployment &> /dev/null; do sleep 1; done" || ( echo >&2 "Timed out while waiting for the Kubernetes cluster to start"; exit 1 )
echo "Done."

FLYTE_VERSION=${FLYTE_VERSION:-latest}
if [[ $FLYTE_VERSION = "latest" ]]
then
FLYTE_VERSION=$(curl --silent "https://api.github.com/repos/flyteorg/flyte/releases/latest" | jq -r .tag_name)
fi

# Deploy flyte
echo "Deploying Flyte..."
helm dep update /flyteorg/share/flyte/
helm upgrade -n flyte -f /flyteorg/share/flyte/values-sandbox.yaml --create-namespace flyte /flyteorg/share/flyte --kubeconfig /etc/rancher/k3s/k3s.yaml --install
helm repo add flyteorg https://flyteorg.github.io/flyte
helm repo update
helm fetch flyteorg/flyte --version=$FLYTE_VERSION
helm upgrade -n flyte -f /flyteorg/share/flyte/values-sandbox.yaml --create-namespace flyte flyteorg/flyte --kubeconfig /etc/rancher/k3s/k3s.yaml --install --version $FLYTE_VERSION

wait-for-flyte.sh

Expand Down

0 comments on commit a9e06ae

Please sign in to comment.