8000 build: push gitpod and codespaces images/packages during release by rfay · Pull Request #6613 · ddev/ddev · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build: push gitpod and codespaces images/packages during release #6613

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

Merged
merged 51 commits into from
Oct 16, 2024

Conversation

rfay
Copy link
Member
@rfay rfay commented Oct 13, 2024

The Issue

We've had the gitpod image and codespaces package pushes as separate tasks for some time, and they weren't always done.

How This PR Solves The Issue

  • Push gitpod image after release build
  • Push codespaces/vscode package after release build
  • If building on ddev-test, push images to ddevhq Docker org so things are safer (the push happens to the variable DOCKER_ORG)
  • Rename containers_shared.mak to containers_shared.mk so that it's recognized as a Makefile and tabs get used
  • Adds a latest tag for Docker images for stable releases. We don't need to use these, and probably shouldn't, but this will remove maintenance of ddev-gitpod-launcher, and may help with how things work for drupalpod eventually. There is a place for latest

Notes

I was overly ambitious here and tried to create a multi-architecture image of the upstream gitpod base image. That attempt was removed in 608a00d because it didn't seem to work quite right. I was trying to recreate the gitpod-sourced image with an alternate build technique, not using their dazzle technique. It didn't seem to me that it was working completely correctly, and I think my proposed use of the arm64 image was probably not as useful as expected.

Manual Testing Instructions

@rfay rfay requested review from a team as code owners October 13, 2024 23:25
Copy link
github-actions bot commented Oct 13, 2024

@rfay
Copy link
Member Author
rfay commented Oct 14, 2024
  • TODO: Unfortunately the FROM we're using, gitpod/workspace-base is built only for amd64, so we're kind of fooling ourselves building a multi-arch image for it. I guess we have to build our own copy of the gitpod/workspace-base in multi-arch.
  • The containertest.sh in the ddev-gitpod-base directory needs to do something, although maybe it doesn't need to do much.

@rfay rfay marked this pull request as draft October 14, 2024 03:42
@rfay rfay force-pushed the 20241013_rfay_auto_push_gitpod branch from 730cb8b to b1fa1ff Compare October 14, 2024 03:43
@rfay rfay force-pushed the 20241013_rfay_auto_push_gitpod branch from 036adf2 to 608a00d Compare October 15, 2024 13:21
@rfay rfay marked this pull request as ready for review October 15, 2024 13:34
@rfay
Copy link
Member Author
rfay commented Oct 15, 2024

OK, ready for your review. That turned out to be a lot more than a Sunday afternoon excursion :)

@rfay rfay requested a review from stasadev October 15, 2024 13:37

VERSION := $(shell git describe --tags --always --dirty)

.PHONY: build clean test

CURRENT_ARCH=$(shell ../get_arch.sh)

# This Makefile explicitly does not include containers/containers_shared.mak,
# This Makefile explicitly does not include containers/containers_shared.mk,
Copy link
Member

Choose a reason for hiding this comment

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

I see test build error for ddev-dbserver:

./build_image.sh: line 123: DOCkER_ORG: unbound variable

build_image.sh needs to pass DOCKER_ORG inside:

8000
cmd="./build_image.sh --db-type=$${DB_TYPE} --db-major-version=$${DB_MAJOR_VERSION} --archs=$${ARCHS} --tag=$(VERSION) --docker-args=$(DOCKER_ARGS)" && \
if [ ! -z $${PUSH} ]; then cmd="$$cmd --push"; fi && \
if [ ! -z $${DB_PINNED_VERSION} ]; then cmd="$$cmd --db-pinned-version=$${DB_PINNED_VERSION}"; fi && \
echo $${cmd} && \
$${cmd}

Copy link
Member Author

Choose a reason for hiding this comment

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

Working on that, fails locally too.


- name: Replace version in devcontainer-feature.json
run: |
sed -i 's/\${DDEV_VERSION}/'"${GITHUB_REF##*/}"'/g' ./containers/devcontainers/install-ddev/devcontainer-feature.json
Copy link
Member
@stasadev stasadev Oct 15, 2024

Choose a reason for hiding this comment

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

${GITHUB_REF##*/} looks the same as ${GITHUB_REF_NAME} from https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables

Edit:

Oh, GITHUB_REF_NAME for PRs: <pr_number>/merge, so the variable needs to be modified anyway.

Okay, it doesn't matter in this case, ignore my comment.

Comment on lines -43 to -61
github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true
# add a label once the prebuild is ready to pull requests (defaults to false)
addLabel: true

Copy link
Member
@stasadev stasadev Oct 15, 2024

Choose a reason for hiding this comment

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

Is this config not needed? I want to understand why we remove it.

Okay I see

Deprecated: Filtering prebuilds via the .gitpod.yml is deprecated.

https://www.gitpod.io/docs/integrations/github-gitpod-yaml

Comment on lines 43 to 45
RUN for item in golang.org/x/tools/gopls@latest github.com/go-delve/delve/cmd/dlv@latest; do \
go install $item; \
done
Copy link
Member

Choose a reason for hiding this comment

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

We should have go clean -modcache here in the same RUN, because go install downloads cache to ~/go/pkg, and it's not removed.

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 wish we'd had this conversation earlier, I might have gotten out of the trouble I was in. I was really surprised about how this popped up when it didn't seem to have been there before. Perhaps upstream changed. Think it's sorted now.

@rfay
Copy link
Member Author
rfay commented Oct 16, 2024

Hard to believe I could get so lost and destabilize so many things in an afternoon journey, but I think it's going now, https://github.com/ddev-test/ddev/releases/tag/v1.23.5-aaa-testgitpod.22 and https://github.com/ddev-test/ddev/actions/runs/11357139682

Please take another look and we'll see where we get.

The reality is that many image Makefiles changed, and by rights new images should be pushed. But we're about to do that. So it would be easier to pull this, push the new images, run the tests.

Copy link
Member
@stasadev stasadev left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0