Skip to content

Commit 4a325f0

Browse files
committed
Wip
1 parent d2d2962 commit 4a325f0

File tree

4 files changed

+53
-15
lines changed

4 files changed

+53
-15
lines changed

.github/workflows/build.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
sudo snap install yq
3737
sudo snap install rockcraft --classic --edge
3838
39-
# - name: Build image
40-
# run: sudo make build
39+
- name: Build image
40+
run: sudo make build
4141

42-
# - name: Build image (Jupyter)
43-
# run: sudo make build FLAVOUR=jupyter
42+
- name: Build image (Jupyter)
43+
run: sudo make build FLAVOUR=jupyter
4444

45-
# - name: Build image (Kyuubi)
46-
# run: sudo make build FLAVOUR=kyuubi
45+
- name: Build image (Kyuubi)
46+
run: sudo make build FLAVOUR=kyuubi
4747

4848
- name: Build image (GPU)
4949
run: sudo make build FLAVOUR=spark-gpu
@@ -61,16 +61,15 @@ jobs:
6161
echo "gpu_artifact_name=${GPU_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
6262
6363
- name: Change artifact permissions
64-
run: sudo chmod a+r ${{ steps.artifact.outputs.gpu_artifact_name }}
65-
# run: sudo chmod a+r ${{ steps.artifact.outputs.base_artifact_name }} ${{ steps.artifact.outputs.jupyter_artifact_name }} ${{ steps.artifact.outputs.kyuubi_artifact_name }} ${{ steps.artifact.outputs.gpu_artifact_name }}
64+
run: sudo chmod a+r ${{ steps.artifact.outputs.base_artifact_name }} ${{ steps.artifact.outputs.jupyter_artifact_name }} ${{ steps.artifact.outputs.kyuubi_artifact_name }} ${{ steps.artifact.outputs.gpu_artifact_name }}
6665

6766
- name: Upload locally built artifact
6867
uses: actions/upload-artifact@v4
6968
with:
7069
name: charmed-spark
71-
# ${{ steps.artifact.outputs.base_artifact_name }}
72-
# ${{ steps.artifact.outputs.jupyter_artifact_name }}
73-
# ${{ steps.artifact.outputs.kyuubi_artifact_name }}
74-
path: |
70+
path: |
71+
${{ steps.artifact.outputs.base_artifact_name }}
72+
${{ steps.artifact.outputs.jupyter_artifact_name }}
73+
${{ steps.artifact.outputs.kyuubi_artifact_name }}
7574
${{ steps.artifact.outputs.gpu_artifact_name }}
7675

.github/workflows/integration-gpu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: machulav/[email protected]
2727
with:
2828
mode: start
29-
github-token: ${{ secrets.GH_TOKEN }}
29+
github-token: ${{ secrets.GHCR_TOKEN }}
3030
ec2-image-id: ${{ vars.AWS_EC2_IMAGE_ID }}
3131
ec2-instance-type: ${{ vars.AWS_EC2_INSTANCE_TYPE }}
3232
subnet-id: ${{ vars.AWS_DEFAULT_SUBNET_ID }}

.github/workflows/publish.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
echo "jupyter_artifact_name=${JUPYTER_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
7575
KYUUBI_ARTIFACT=$(make help FLAVOUR=kyuubi | grep 'Artifact: ')
7676
echo "kyuubi_artifact_name=${KYUUBI_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
77+
GPU_ARTIFACT=$(make help FLAVOUR=spark-gpu | grep 'Artifact: ')
78+
echo "gpu_artifact_name=${GPU_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
7779
7880
- name: Download artifact
7981
uses: actions/download-artifact@v4
@@ -185,6 +187,42 @@ jobs:
185187

186188
docker tag ${IMAGE_NAME}:${TAG} ${IMAGE_NAME}:${VERSION_TAG}
187189

190+
echo "Publishing ${IMAGE_NAME}:${VERSION_TAG}"
191+
docker push ${IMAGE_NAME}:${VERSION_TAG}
192+
fi
193+
- name: Publish Charmed Spark GPU Image to Channel
194+
run: |
195+
# Unpack artifact
196+
mv charmed-spark/${{ steps.artifact.outputs.gpu_artifact_name }} .
197+
rmdir charmed-spark
198+
199+
REPOSITORY="ghcr.io/canonical/"
200+
RISK=${{ needs.release_checks.outputs.risk }}
201+
TRACK=${{ needs.release_checks.outputs.track }}
202+
if [ ! -z "$RISK" ] && [ "${RISK}" != "no-risk" ]; then TAG=${TRACK}_${RISK}; else TAG=${TRACK}; fi
203+
204+
# Import artifact into docker with new tag
205+
sudo make docker-import \
206+
FLAVOUR=spark-gpu \
207+
REPOSITORY=${REPOSITORY} \
208+
TAG=${TAG} \
209+
-o ${{ steps.artifact.outputs.gpu_artifact_name }}
210+
211+
# Add relevant labels
212+
COMMIT_ID=$(git log -1 --format=%H)
213+
DESCRIPTION=$(yq .description images/charmed-spark-gpu/rockcraft.yaml | xargs)
214+
215+
echo "FROM ${IMAGE_NAME}:${TAG}" | docker build --label org.opencontainers.image.description="${DESCRIPTION}" --label org.opencontainers.image.revision="${COMMIT_ID}" --label org.opencontainers.image.source="${{ github.repositoryUrl }}" -t "${IMAGE_NAME}:${TAG}" -
216+
217+
echo "Publishing ${IMAGE_NAME}:${TAG}"
218+
docker push ${IMAGE_NAME}:${TAG}
219+
220+
if [[ "$RISK" == "edge" ]]; then
221+
VERSION_LONG=$(make help FLAVOUR=spark-gpu | grep "Tag\:" | cut -d ":" -f2 | xargs)
222+
VERSION_TAG="${VERSION_LONG}-${{ needs.release_checks.outputs.base }}_edge"
223+
224+
docker tag ${IMAGE_NAME}:${TAG} ${IMAGE_NAME}:${VERSION_TAG}
225+
188226
echo "Publishing ${IMAGE_NAME}:${VERSION_TAG}"
189227
docker push ${IMAGE_NAME}:${VERSION_TAG}
190228
fi

images/charmed-spark-gpu/rockcraft.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: charmed-spark-gpu
2-
summary: Charmed Apache Spark ROCK
2+
summary: Charmed Apache Spark ROCK with Spark Rapids support
33
description: |
44
This is an OCI image that bundles Apache Spark binaries together with other
55
tools of its ecosystem in order to be used in Charmed Operators, providing
66
an automated and seamless experience to deploy, operate, manage and monitor
7-
SparkJob on K8s cluster.
7+
SparkJob on K8s cluster.
8+
This image includes support for Nvidia Spark Rapids.
89
It is an open source, end-to-end, production ready data platform on top of
910
cloud native technologies.
1011

0 commit comments

Comments
 (0)