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

tasks: Add job-runner.toml configuration #586

Merged
merged 2 commits into from
Mar 7, 2024
Merged

tasks: Add job-runner.toml configuration #586

merged 2 commits into from
Mar 7, 2024

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Mar 5, 2024

tasks: Add job-runner.toml configuration

This will allow us to enable job-runner in
cockpit-project/bots#6017.

Do this both for our production bots as well as our run-local.sh
integration tests.


I tested this locally against COCKPIT_BOTS_BRANCH=job-runner tasks/run-local.sh and it passes.

I rolled this out to rhos-01-1:

ansible -v -i inventory -m include_role -a name=tasks-systemd -e instances=1 -l rhos-01-1 openstack_tasks

I tested it on rhos01-1 in a git clone -b job-runner https://github.com/cockpit-project/bots b.

I created a test image refresh issue on cockpit-project/bots#6034 , and started it with the job-runner command mentioned in the issue. Everything worked.

I also ran

./job-runner run --slug 'test-manual-starter-kit-1' cockpit-project/starter-kit

(without config arguments!), it took the $JOB_RUNNER_CONFIG and spat out https://cockpit-logs.us-east-1.linodeobjects.com/test-manual-starter-kit-1/log.html . The test passed, but it pointed out a problem: The per-job instances desperately need to use the image cache, otherwise each test will download them. Adding a TODO.

martinpitt added a commit to cockpit-project/bots that referenced this pull request Mar 5, 2024
Co-develop the two branches until the cockpituous one lands.
martinpitt added a commit to cockpit-project/bots that referenced this pull request Mar 5, 2024
Co-develop the two branches until the cockpituous one lands.
@martinpitt

This comment was marked as resolved.

@martinpitt martinpitt mentioned this pull request Mar 6, 2024
martinpitt added a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
@martinpitt martinpitt force-pushed the runner-toml branch 2 times, most recently from c5d3f0f to 7f5f305 Compare March 6, 2024 05:19
martinpitt added a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
@martinpitt martinpitt force-pushed the runner-toml branch 3 times, most recently from dac8b3c to a77bece Compare March 6, 2024 09:29
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 6, 2024
Co-develop the two branches until the cockpituous one lands.
@martinpitt martinpitt force-pushed the runner-toml branch 3 times, most recently from 8fd5876 to e0ea762 Compare March 7, 2024 07:31
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 7, 2024
Co-develop the two branches until the cockpituous one lands.
@martinpitt martinpitt changed the title tasks: Create job-runner.toml in run-local.sh tasks: Add job-runner.toml configuration Mar 7, 2024

[container]
command = ['podman-remote', '--url=unix:///podman.sock']
run-args = ['--device=/dev/kvm']
Copy link
Member

Choose a reason for hiding this comment

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

That's going to need to get a bit bigger. In addition to the issue about the cache dir you pointed out, at least these are missing:

  • --memory=24g
  • --pids-limit=16384
  • --shm-size=1024m
  • ${TMPVOL} moral equivalent

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Confirmed in podman exec, and I also did a podman run to get the full joy of 8x parallelism: https://cockpit-logs.us-east-1.linodeobjects.com/test-podman-1/log.html .

This doesn't affect the running container.

(After this saga, we'll split that directory)
@martinpitt martinpitt marked this pull request as ready for review March 7, 2024 14:07
allisonkarlitskaya pushed a commit to cockpit-project/bots that referenced this pull request Mar 7, 2024
Co-develop the two branches until the cockpituous one lands.
This will allow us to enable job-runner in
cockpit-project/bots#6017.

Do this both for our production bots as well as our run-local.sh
integration tests.
'--shm-size=1024m',
# qcow overlays on tmpfs
'--tmpfs=/tmp:size=14g',
'--env=TEST_OVERLAY_DIR=/tmp',
Copy link
Member Author

Choose a reason for hiding this comment

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

@allisonkarlitskaya FYI, I just added this so that we can eventually drop

TEST_OVERLAY_DIR=/tmp
which is a bit ugly, too disconnected from the other half (i.e. the --tmpfs), and won't work with other containers.

I also reordered these by purpose instead of primarily on type, which makes it a bit easier to maintain/understand.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like a bit more vertical whitespace would help keeping the sections visually separated from each other...

Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

This can go as-is if you disagree with my suggestions. I have a feeling you'll be doing another round anyway, though...

driver='s3'

[forge.github]
token = [{file="/run/secrets/webhook/.config--github-token"}]
Copy link
Member

Choose a reason for hiding this comment

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

(feel free to say no) can you get us an extra --volume for /var/secrets/github-token and use it from that location?

[logs.s3]
# bots lib/stores.py LOG_STORE
url = 'https://cockpit-logs.us-east-1.linodeobjects.com/'
key = [{file="/run/secrets/tasks/s3-keys/cockpit-logs.us-east-1.linodeobjects.com"}]
Copy link
Member

Choose a reason for hiding this comment

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

ditto for this (ie: /run/secrets/s3-keys/cockpit-logs.us-east-1.linodeobjects.com)

# various configuration
'--volume=/etc/npmrc:/etc/npmrc:ro',
'--volume=/var/cache/cockpit-tasks/images:/cache/images:rw',
'--env=TEST_JOBS={{ TEST_JOBS | default(8) }}',
Copy link
Member

Choose a reason for hiding this comment

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

How about GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL? I'm not sure if we also need COMMITTER but I assume it'll default to author if it's not set?

'--shm-size=1024m',
# qcow overlays on tmpfs
'--tmpfs=/tmp:size=14g',
'--env=TEST_OVERLAY_DIR=/tmp',
Copy link
Member

Choose a reason for hiding this comment

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

I feel like a bit more vertical whitespace would help keeping the sections visually separated from each other...

@martinpitt martinpitt merged commit 4586835 into main Mar 7, 2024
3 checks passed
@martinpitt martinpitt deleted the runner-toml branch March 7, 2024 15:41
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.

2 participants