You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an open source process it makes a lot of sense to allow everyone to use cirrus-ci in their forks using the "free" credits, but to use custom compute or persistent runners for the, commonly much higher, usage of the project itself. The switch would need to happen based on what's present in repository level environment variables. Right now that's somewhat painful to implement in .cirrus.yml however.
Part of the issue are some small differences in the way tasks are specified. E.g. for custom_engine_instance: image families are specified via image: family/docker-kvm whereas for gce_instance: they are specified as image_family: ubuntu-2204-lts-arm64.
My current best guess for how to implement this is something roughly like:
I think you can already achieve this using Starlark and CIRRUS_REPO_OWNER environment variable. You can extract the YAML achors in two different files like .ci/our_instances.yml and .ci/cirrus_instances.yml and put something like the following in your .cirrus.star file:
Unfortunately I think that doesn't work, presumably due to yaml anchors having to be defined before they're used, and the starlark configuration is appended to .cirrus.yml. I get Error while parsing tasks: INVALID_ARGUMENT: yaml: unknown anchor 'linux_instance' referenced!
and .cirrus.star isn't even executed.
Hi,
For an open source process it makes a lot of sense to allow everyone to use cirrus-ci in their forks using the "free" credits, but to use custom compute or persistent runners for the, commonly much higher, usage of the project itself. The switch would need to happen based on what's present in repository level environment variables. Right now that's somewhat painful to implement in
.cirrus.yml
however.Part of the issue are some small differences in the way tasks are specified. E.g. for
custom_engine_instance:
image families are specified viaimage: family/docker-kvm
whereas forgce_instance:
they are specified asimage_family: ubuntu-2204-lts-arm64
.My current best guess for how to implement this is something roughly like:
Which does end up somewhat painful...
Thanks,
Andres
The text was updated successfully, but these errors were encountered: