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

Build both agent and inbound-agent container images in this repository #569

Open
lemeurherve opened this issue Nov 28, 2023 · 13 comments
Open

Comments

@lemeurherve
Copy link
Member

lemeurherve commented Nov 28, 2023

What

I propose to build both images in this repository.

Why

  • Faster agents release:
    • Both images build in the same job
      • in parallel in case of Linux images
      • sequentially in case of Windows images, with inbound-agent benefiting from the agent container image build cache
    • No need to wait merging docker-agent image, wait for the tag then the publication on Docker Hub, then updatecli PR on docker-inbound agent, merge, tag and publication again.
  • Less work and maintenance
  • No change whatsoever for final users
    • Same Docker Hub repositories, images, tags and content
  • No practical change for contributors
    • Better possibilities for custom local builds and tests

How

Code wise

I'm using multistages Dockerfiles, docker bake's matrix for Linux images (allowing parallel builds), and a loop over "agent" and "inbound-agent" with docker compose and --target for Windows images.

I've splitted my pull requests commits:

  • Renamed agent files
  • Imported files from inbound-agent, with their related git history reapplied as patch
  • One atomic commit with all code changes

New file

  • README.md

Modified

  • .gitignore
  • alpine/Dockerfile
  • build.ps1
  • build.sh
  • debian/Dockerfile
  • debian/preview/Dockerfile
  • docker-bake.hcl
  • Jenkinsfile
  • Makefile
  • tests/agent.Tests.ps1
  • tests/test_helpers.bash
  • tests/test_helpers.psm1
  • windows/nanoserver/Dockerfile
  • windows/windowsservercore/Dockerfile

Renamed from agent

  • README_agent.md

Renamed and modified from agent

  • tests/tests_agent.bats

Imported from inbound-agent

  • jenkins-agent
  • jenkins-agent.ps1
  • tests/netcat-helper/Dockerfile
  • tests/netcat-helper/Dockerfile-windows

Imported and renamed from inbound-agent

  • README_inbound-agent.md

Imported and modified from inbound-agent

  • tests/inbound-agent.Tests.ps1

Imported, renamed and modified from inbound-agent

  • .github/workflows/sync-dockerhub-readme.yml
  • tests/tests_inbound-agent.bats

PR preview: lemeurherve/docker-agent@master...feat-build-both-agent-and-inbound-agent
Main commit: lemeurherve@8f27a4e

Repo wise

At first I was about to ask about which repo use as final repo between docker-agent and docker-inbound-agent, but after more reflexion (and all the work on git history), I think this repo makes more sense as the only benefit of inbound-agent repo would be some more GitHub stars and watchers.

If going that way, merging the PR will allow testing a real publication of agent and inbound-agent for this repo to validate the process.

Then, we could:

  • Add a "inbound-label" to every inbound-agent repo issues
  • Transfer these issues here
  • (Optional) Create a last 999.999.999 empty inbound-agent release with a warning/note in the release note mentioning the move to the docker-agent repo, so users will get a notification
  • Add the same kind of mention in inbound-agent README
  • Archive inbound-agent repo
  • (Optional) Rename this repo to reflect it contains both agent. Suggestions: "docker-agents", "docker-agent-inbound"
  • Adapt jobs on ci.jenkins.io and trusted.ci.jenkins.io
    • Rename the "agent" ones
    • Remove the "inbound-agent" ones

Alternative:
Create a new repo like "docker-agent-inbound" for example, then label and transfer issues from the existing repos, then archive then. (+ optional "warning" releases).
This option is fine to me too as I would simply have to change the git reference in my local repo config to push to it.

@jenkinsci/team-docker-packaging WDYT?

@timja
Copy link
Member

timja commented Nov 29, 2023

sounds good to me

@lemeurherve
Copy link
Member Author

Opened #570

@lemeurherve
Copy link
Member Author

lemeurherve commented Jan 13, 2024

@jenkinsci/team-docker-packaging now that #570 has been merged and released, is there any objection or suggestion about the following next steps plan?

@timja
Copy link
Member

timja commented Jan 13, 2024

Makes sense

@lemeurherve
Copy link
Member Author

lemeurherve commented Jan 16, 2024

Update:

  • Issues from both repos tagged with "agent" or "inbound-agent" labels
  • Docker-inbound-agent issues transferred here (sorry for the noise I didn't realize a notification would be sent for each of them)
  • Docker-inbound-agent jobs disabled on ci.jenkins.io and trusted.jenkins.io (they will be removed at the end)
  • Docker-inbound-agent GitHub Actions disabled
  • Description of this repo updated

Next steps are blocked by this repo renaming.

As the SSH agent image hasn't the same lifecycle, no other repo is expected to be merged here.
My favorite suggestion as new name is docker-agent-inbound, I've asked for feedback about it here and in the docker and infra matrix channels but no response yet.

If there is no objection in the next day(s), I'll proceed to this renaming so pull requests like #583 can be avoided and this issue continued.

@lemeurherve lemeurherve pinned this issue Jan 16, 2024
@lemeurherve
Copy link
Member Author

As there are some discussions about the renaming, I'll keep the name docker-agent for now to proceed to the next steps, then I'll open a new issue dedicated to the choice of the new repo name, with the current suggestions.

@lemeurherve
Copy link
Member Author

Final GitHub inbound agent release published: https://github.com/jenkinsci/docker-inbound-agent/releases/tag/3206.vb_15dcf73f6a_9-2

Deprecation notice before archival: jenkinsci/docker-inbound-agent#469

@lemeurherve
Copy link
Member Author

I haven't found out how to remove https://ci.jenkins.io/job/Packaging/job/docker-inbound-agent/ from ci.jenkins.io, it's not in the parent Packaging folder filter anymore but even after a scan there is no option to delete it.
Any idea?

@lemeurherve
Copy link
Member Author

Should we keep the inbound-agent job on trusted.ci.jenkins.io for history purpose? (Tag builds)

@timja
Copy link
Member

timja commented Jan 21, 2024

I normally remove the jobs on disk for this sort of problem. In theory it’ll go away eventually but it’s a bit of a short coming of the organisation folder setup

@dduportal
Copy link
Contributor

I normally remove the jobs on disk for this sort of problem. In theory it’ll go away eventually but it’s a bit of a short coming of the organisation folder setup

In this case, as it is trusted.ci, I recommend to disable the job to keep it, and add a TTL of 6 month;

  • Add a note in the job description pointing to here and the TTL date
  • Add a calendar event for Jenkins infra team with the TTL and the link here

@timja
Copy link
Member

timja commented Jan 22, 2024

The question was in reference to ci.jenkins.io not trusted.ci.jenkins.io fwiw.

@lemeurherve
Copy link
Member Author

lemeurherve commented Jan 22, 2024

  • Add a note in the job description pointing to here and the TTL date
  • Add a calendar event for Jenkins infra team with the TTL and the link here

Thanks, added these steps for trusted.ci.jenkins.io to the plan.

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

No branches or pull requests

3 participants