Skip to content

Add docker-build workflow (#942)#970

Merged
jelmer merged 1 commit into
isso-comments:masterfrom
janw:add-docker-build-workflow
Mar 10, 2024
Merged

Add docker-build workflow (#942)#970
jelmer merged 1 commit into
isso-comments:masterfrom
janw:add-docker-build-workflow

Conversation

@janw

@janw janw commented Sep 6, 2023

Copy link
Copy Markdown
Contributor

Checklist

  • All new and existing tests are passing
  • (If docs changes needed:) I have updated the documentation accordingly.
  • I have added an entry to CHANGES.rst because this is a user-facing change or an important bugfix
  • I have written proper commit message(s)

What changes does this Pull Request introduce?

This PR adds an automated docker build using GH actions.

Images are build automatically for the following patterns:

  • PR is opened/updated: builds and tags the image but does not push it to the registry (this is done to verify a successful build; example build)
  • Push to master (i.e. merge a PR): build and tag image with :latest (example build)
  • Push a new tag (i.e. release new version): build and tag with
    • major version only (i.e. :0), and major+minor version (i.e. :0.14) (example build)
    • full version (i.e. :0.14.1-post.0) (example build)

Furthermore this includes a multi-arch docker build: the image will be build for linux/amd64, and linux/arm64/v8, arguably the most common platforms for both large production environments and small-scale self-hosted applications.

Example image are available via my fork: https://github.com/janw/isso/pkgs/container/isso

Why is this necessary?

@janw janw marked this pull request as ready for review September 6, 2023 18:39
@janw janw marked this pull request as draft September 6, 2023 18:39
@janw janw marked this pull request as ready for review September 6, 2023 22:08
@janw janw changed the title WIP: Add docker-build workflow (#942) Add docker-build workflow (#942) Sep 6, 2023
@jelmer

jelmer commented Sep 8, 2023

Copy link
Copy Markdown
Member

We probably need to work out where exactly we want the docker images to live, GitHub doesn't make it very easy to publish docker images cross-user/org.

@ix5 do we want to move the main repo to the isso-comments org at some point?

@BBaoVanC

BBaoVanC commented Sep 9, 2023

Copy link
Copy Markdown
Contributor

What other repo is there, why not just publish the images to here?

@jelmer

jelmer commented Sep 9, 2023

Copy link
Copy Markdown
Member

This PR uses the ghcr.io/isso-comments namespace, and I think the plan is also to move this repo to GitHub.com/isso-comments/isso eventually

@ix5

ix5 commented Sep 11, 2023

Copy link
Copy Markdown
Member

I talked to @posativ about moving the repo over to the org, but can't quite remember what prevented us from doing that.

PR itself LGTM.

Comment thread .github/workflows/docker-build.yaml
@ix5

ix5 commented Sep 19, 2023

Copy link
Copy Markdown
Member

Just to make it clear, this is blocked until we have a decision about moving the repo over to the org.

@ix5 ix5 added testing/ci Test coverage & GitHub actions etc. meta Concerning the general direction and organisation of the project improvement Not a new feature, but makes Isso more pleasant to use labels Sep 19, 2023
@ix5 ix5 added this to the 0.14 milestone Sep 19, 2023
@jelmer

jelmer commented Oct 14, 2023

Copy link
Copy Markdown
Member

Just to make it clear, this is blocked until we have a decision about moving the repo over to the org.

could we just publish to posativ/isso in the mean time?

@ix5

ix5 commented Oct 18, 2023

Copy link
Copy Markdown
Member

Just to make it clear, this is blocked until we have a decision about moving the repo over to the org.

could we just publish to posativ/isso in the mean time?

That would be fine by me, but I don't have access to the Settings repo tab (for posativ/isso) to add a deploy key as a secret.

I do have access to the isso-comments org and could add the deploy key as an accepted one, just as I have done for the GitHub pages repo (see sso-comments/isso-comments.github.io).

So either way, we're blocked until Martin finds time to act on this.

@janw

janw commented Dec 11, 2023

Copy link
Copy Markdown
Contributor Author

Just checking in, is there anything you need from me to help move this forward? I'd be happy to assist in any way necessary.

@jelmer

jelmer commented Dec 11, 2023

Copy link
Copy Markdown
Member

Thanks; I think we're basically just waiting from a response from @posativ

@jelmer

jelmer commented Mar 10, 2024

Copy link
Copy Markdown
Member

The repo has now been migrated, and references are being updated in #996 so let's land this!

@jelmer jelmer merged commit b587a74 into isso-comments:master Mar 10, 2024
@janw janw deleted the add-docker-build-workflow branch March 12, 2024 10:53

@ix5 ix5 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I hadn't realized this at the time, but this change means we're re-building the :latest docker tag on every push to master.

Up until this change, I had handled the docker image policy as :latest for the latest tagged release (0.13 at the time IIRC) and :dev for images from the master branch.

Could we please change back to :latest being the latest release, not "bleeding edge" master branch?

type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The way I read this, the action rebuilds and pushes the :latest image on every push to the default branch (=master).

@jelmer

jelmer commented Apr 13, 2024

Copy link
Copy Markdown
Member

I think it's pretty common in docker that latest just refers to whatever the latest thing that was built and pushed was; the way the latest tag works in docker this is pretty common hard to avoid.

I think that if we want to have a docker tag for the latest release, we should just create a new ":release" tag and update that accordingly.

That said, I think it's good practice for people to specify an explicit version (v1.0) as a tag so that their service don't get silently upgraded whenever they restart their services, including any regressions that may cause.

@ix5 ix5 modified the milestones: 0.14, 0.13.1 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Not a new feature, but makes Isso more pleasant to use meta Concerning the general direction and organisation of the project testing/ci Test coverage & GitHub actions etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add Multi-CPU architecture for Docker image

4 participants