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 image used for CircleCI #664

Merged
merged 2 commits into from
May 23, 2024
Merged

Update image used for CircleCI #664

merged 2 commits into from
May 23, 2024

Conversation

matthew-white
Copy link
Member

When I view a build in CircleCI, I see the following warning (e.g., here):

This job is using a deprecated image 'ubuntu-2004:202201-02', please update to a newer image

This PR resolves the warning by updating the image.

What has been done to verify that this works as intended?

CircleCI continues to pass.

Why is this the best possible solution? Were any other approaches considered?

This PR targets the current version of Ubuntu 20.04. If we were concerned that we might introduce something to Central that would work in a new version of Ubuntu 20.04, but not an older one, we could intentionally target an older version. It looks like one of the options is previous, which is 3–6 months old, though I think that's Ubuntu 22.04. That link says, "We recommend using the default version and not pinning to a date version." The list of images available for Ubuntu 20.04 is here.

Relatedly, I saw that Ubuntu 20.04 will reach EOL in 2025. With that in mind, I tried specifying image: default. It looks like that's currently ubuntu-2204:2024.04.4. However, when I do so, CircleCI fails. From a glance, it looks like pm2 isn't working as expected. That sounds like it could be an issue worth looking into. I'm not able to do so at this particular moment, but I'd be happy to file an issue about it if that'd be helpful.

Before submitting this PR, please make sure you have:

  • branched off and targeted the next branch OR only changed documentation/infrastructure (master is stable and used in production)
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@matthew-white
Copy link
Member Author

I tried specifying image: default. It looks like that's currently ubuntu-2204:2024.04.4. However, when I do so, CircleCI fails. From a glance, it looks like pm2 isn't working as expected.

A little more information on this. The output from npx pm2 list wasn't visible in that failure, so I redid it here. I see:

+ docker compose exec -T service npx pm2 list
┌────┬────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name       │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ service    │ default     │ 0.1.0   │ cluster │ 77       │ 35s    │ 0    │ online    │ 0%       │ 85.2mb   │ root     │ disabled │
└────┴────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

Compare that to the passing build here:

+ docker compose exec -T service npx pm2 list
┌────┬────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name       │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ service    │ default     │ 0.1.0   │ cluster │ 76       │ 15s    │ 0    │ online    │ 0%       │ 117.5mb  │ root     │ disabled │
│ 1  │ service    │ default     │ 0.1.0   │ cluster │ 83       │ 15s    │ 0    │ online    │ 0%       │ 118.2mb  │ root     │ disabled │
│ 2  │ service    │ default     │ 0.1.0   │ cluster │ 90       │ 15s    │ 0    │ online    │ 0%       │ 117.2mb  │ root     │ disabled │
│ 3  │ service    │ default     │ 0.1.0   │ cluster │ 97       │ 15s    │ 0    │ online    │ 0%       │ 117.9mb  │ root     │ disabled │
└────┴────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

@matthew-white
Copy link
Member Author

The output from npx pm2 list wasn't visible in that failure

I just pushed a commit that will display the output from npx pm2 list. It takes the same approach as right above in the CircleCI config.

@@ -37,4 +37,9 @@ jobs:
appropriate/curl -4 --insecure --retry 20 --retry-delay 2 --retry-connrefused https://localhost/v1/projects \
| tee /dev/tty \
| grep -q '\[\]'
docker compose exec -T service npx pm2 list | grep -c "online" | grep -q 4 || exit 1
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 removed exit 1, because if grep -q 4 doesn't find 4, it should already return with an exit status of 1. That alone will cause the command to exit, since CircleCI runs bash with -e (docs). The other uses of grep above don't use exit.

Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

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

Thank you! I left it as-is when I did the last update pass here thinking that there were unlikely to be changes that would affect host functionality between releases of 20.04. I do think we should generally track what we use in Cloud which is currently 20.04 latest. That means this is indeed an improvement and we can look into the pm2 issue when we plan on doing an upgrade to hosts.

@matthew-white matthew-white merged commit e284e52 into next May 23, 2024
1 check passed
@matthew-white matthew-white deleted the circleci-image branch May 23, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants