Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-6154] Update rockcraft.yaml recipes using newer Rockcraft features #124

Draft
wants to merge 6 commits into
base: 3.4-22.04/edge
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ AZURE_MARKER=$(_MAKE_DIR)/azure.tag


# The names of different flavours of the image in the docker container registry
STAGED_IMAGE_DOCKER_ALIAS=staged-charmed-spark:latest
SPARK_DOCKER_ALIAS=charmed-spark:$(SPARK_VERSION)
SPARK_GPU_DOCKER_ALIAS=charmed-spark-gpu:$(SPARK_VERSION)
JUPYTER_DOCKER_ALIAS=charmed-spark-jupyter:$(SPARK_VERSION)-$(JUPYTER_VERSION)
Expand Down Expand Up @@ -186,15 +185,11 @@ rock: $(ROCK_FILE)


# Recipe that builds Spark image and exports it to a tarfile in the current directory
$(SPARK_MARKER): $(ROCK_FILE) images/charmed-spark/Dockerfile
$(SPARK_MARKER): $(ROCK_FILE)
rockcraft.skopeo --insecure-policy \
copy \
oci-archive:"$(ROCK_FILE)" \
docker-daemon:"$(STAGED_IMAGE_DOCKER_ALIAS)"

docker build -t $(SPARK_DOCKER_ALIAS) \
--build-arg BASE_IMAGE="$(STAGED_IMAGE_DOCKER_ALIAS)" \
images/charmed-spark-gpu
docker-daemon:"$(SPARK_DOCKER_ALIAS)"

docker save $(SPARK_DOCKER_ALIAS) -o $(SPARK_ARTIFACT)

Expand Down Expand Up @@ -244,15 +239,11 @@ rock-gpu: $(ROCK_FILE_GPU)


# Recipe that builds Spark GPU image and exports it to a tarfile in the current directory
$(SPARK_GPU_MARKER): $(ROCK_FILE_GPU) images/charmed-spark-gpu/Dockerfile
$(SPARK_GPU_MARKER): $(ROCK_FILE_GPU)
rockcraft.skopeo --insecure-policy \
copy \
oci-archive:"$(ROCK_FILE_GPU)" \
docker-daemon:"$(STAGED_IMAGE_DOCKER_ALIAS)"

docker build -t $(SPARK_GPU_DOCKER_ALIAS) \
--build-arg BASE_IMAGE="$(STAGED_IMAGE_DOCKER_ALIAS)" \
images/charmed-spark-gpu
docker-daemon:"$(SPARK_GPU_DOCKER_ALIAS)"

docker save $(SPARK_GPU_DOCKER_ALIAS) -o $(SPARK_GPU_ARTIFACT)

Expand Down
4 changes: 0 additions & 4 deletions images/charmed-spark-gpu/Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion images/charmed-spark-gpu/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ platforms:
amd64:

run_user: _daemon_
entrypoint-service: sparkd

environment:
SPARK_HOME: /opt/spark
Expand All @@ -33,7 +34,7 @@ environment:

services:
sparkd:
command: "/bin/bash /opt/pebble/sparkd.sh"
command: "/bin/bash /opt/pebble/sparkd.sh [ sleep ]"
summary: "This is the service to startup Spark processes using the Spark entrypoint"
override: replace
startup: enabled
Expand Down
4 changes: 0 additions & 4 deletions images/charmed-spark/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion images/charmed-spark/bin/sparkd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ case "${FLAVOUR}" in
pushd /opt/spark
./entrypoint.sh "$@"
;;
"")
""|"sleep")
# Infinite sleep to allow pebble to be running indefinitely
sleep inf
;;
Expand Down
3 changes: 2 additions & 1 deletion images/charmed-spark/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ platforms:
amd64:

run_user: _daemon_
entrypoint-service: sparkd

environment:
SPARK_HOME: /opt/spark
Expand All @@ -32,7 +33,7 @@ environment:

services:
sparkd:
command: "/bin/bash /opt/pebble/sparkd.sh"
command: "/bin/bash /opt/pebble/sparkd.sh [ sleep ]"
summary: "This is the service to startup Spark processes using the Spark entrypoint"
override: replace
startup: enabled
Expand Down
Loading