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

Pass argument '--rm' to avoid wkdev-create container name collission #59

Draft
wants to merge 1 commit into
base: main
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
12 changes: 4 additions & 8 deletions .github/workflows/wkdev-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ jobs:

- name: Test image
run: |
CONTAINER="wkdev-$(date +%s)"
source ./register-sdk-on-host.sh
wkdev-create --create-home --home ${HOME}/${CONTAINER}-home --verbose --attach --no-pull --name ${CONTAINER}
wkdev-enter -n ${CONTAINER} --exec -- git clone --depth=1 https://github.com/WebKit/WebKit.git
wkdev-enter -n ${CONTAINER} --exec -- ./WebKit/Tools/Scripts/build-webkit --wpe --release --generate-project-only
wkdev-enter -n ${CONTAINER} --exec -- ./WebKit/Tools/Scripts/build-webkit --gtk --release --generate-project-only
podman stop ${CONTAINER} || true
podman rm ${CONTAINER} || true
rm -rf ${HOME}/${CONTAINER}-home
wkdev-create --create-home --verbose --attach --no-pull --rm
wkdev-enter --exec -- git clone --depth=1 https://github.com/WebKit/WebKit.git
wkdev-enter --exec -- ./WebKit/Tools/Scripts/build-webkit --wpe --release --generate-project-only
wkdev-enter --exec -- ./WebKit/Tools/Scripts/build-webkit --gtk --release --generate-project-only

deploy:
runs-on: self-hosted
Expand Down
4 changes: 4 additions & 0 deletions scripts/host-only/wkdev-create
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ process_command_line_arguments() {
host_hostname="$(hostnamectl hostname)"
container_hostname="$(basename "${container_name}").${host_hostname}"

if argsparse_is_option_set "create-home" && -d "${container_user_home}"; then
rm -rf "${container_user_home}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was always afraid about adding an option that does an rm -rf :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a counterpart of wkdev-create but to remove a container.

Now in the runner there's:

$ podman ps
CONTAINER ID  IMAGE                            COMMAND               CREATED      STATUS          PORTS       NAMES
97f83258b59f  ghcr.io/igalia/wkdev-sdk:latest  /wkdev-sdk/script...  3 weeks ago  Up 3 weeks ago              wkdev-1727468367
fa1c67dc62f4  ghcr.io/igalia/wkdev-sdk:latest  /wkdev-sdk/script...  3 weeks ago  Up 4 days ago               wkdev

For some reason, the temporal container wkdev-1727468367 was not removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually used podman rm directly. However, I'm not objecting to a wkdev-destroy script.

fi

# Verify the container home directory is accessible.
if [ ! -d "${container_user_home}" ]; then
if ! argsparse_is_option_set "create-home"; then
Expand Down
Loading