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

Update Docker Client User Agent in CI #15268

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Feb 23, 2021

We do this so we can get better analytics for the downloaded version of the build images (by being able to easily filter out image downloads originating from CI).

Docker CLI mentioning this capability can be found here.

@quarkus-bot quarkus-bot bot added the area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure label Feb 23, 2021
@geoand
Copy link
Contributor Author

geoand commented Feb 23, 2021

cc @gsmet @cescoffier

I am going to see what this looks like on my fork before promoting

@geoand geoand force-pushed the docker-client-http-headers branch from 1609828 to b37bd7e Compare February 23, 2021 13:56
@geoand
Copy link
Contributor Author

geoand commented Feb 23, 2021

Before my change the docker config looks like:

{
	"auths": {
		"https://index.docker.io/v1/": {
			"auth": "****"
		}
	}
}

After the change it looks like:

{
  "auths": {
    "https://index.docker.io/v1/": {
      "auth": "****"
    }
  },
  "HttpHeaders": {
    "User-Agent": "Quarkus-CI-Docker-Client"
  }
}

@geoand geoand force-pushed the docker-client-http-headers branch from b37bd7e to f147f0c Compare February 23, 2021 14:04
@geoand geoand marked this pull request as ready for review February 23, 2021 14:04
@geoand geoand requested a review from gsmet February 23, 2021 14:04
Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Very good idea!

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 23, 2021
@geoand
Copy link
Contributor Author

geoand commented Feb 23, 2021

Very good idea!

Thanks :)

@geoand geoand merged commit 3b36a59 into quarkusio:master Feb 23, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Feb 23, 2021
@geoand geoand deleted the docker-client-http-headers branch February 23, 2021 17:49
- name: Update Docker Client User Agent
shell: bash
run: |
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Quarkus-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json
Copy link
Member

Choose a reason for hiding this comment

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

I would add the github org/repo name into the agent (based on github actons vars) - then we can distinguish between quarkus core builds and contributors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought of that but decided against it because it would potentially make filtering harder (I don't know how filtering is done, so I wanted to be on the safe side)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants