Skip to content

Conversation

@gabriel-samfira
Copy link
Member

@gabriel-samfira gabriel-samfira commented Sep 26, 2025

This change adds 2 new options to gitea forge endpoints:

  • Tools metadata URL
  • Use internal tools URLs

By default, GARM looks in the releases page of the gitea act_runner to determine where it can download the runner binary from for a particular OS/arch. The tools metadata URL option can be set on an endpoint and can point to a mirror of the upstream repo. The requirement is that the asset names exactly mirror upstream naming conventions.

You can create a mirror of the upstream act_runner repo using a script such as this: https://gist.github.com/gabriel-samfira/006ecd5802dbb25e70348601a776c369

The second option disables GARM calling out to the tools metadata URL entirely. GARM has some hardcoded values for nightly binaries. If this option is checked, GARM will use those values, without making any kind of outgoing API call to determine availability. This is useful in air-gapped environments.

In the UI, the update modal now includes both options:

image

The CLI now has 2 new options when adding and updating the endpoints:

garm-cli gitea endpoint update local-gitea --tools-metadata-url="https://gitea.com/api/v1/repos/gitea/act_runner/releases" --use-internal-tools-metadata=true
+---------------------------------+----------------------------------------------------------+
| FIELD                           | VALUE                                                    |
+---------------------------------+----------------------------------------------------------+
| Name                            | local-gitea                                              |
| Description                     | My first Gitea endpoint                                  |
| Created At                      | 2025-05-14 21:36:53.583620259 +0000 UTC                  |
| Updated At                      | 2025-09-26 15:08:51.793498548 +0000 UTC                  |
| Base URL                        | http://10.0.9.5/                                         |
| Tools metadata URL              | https://gitea.com/api/v1/repos/gitea/act_runner/releases |
| Use internal tools metadata URL | true                                                     |
| API Base URL                    | http://10.0.9.5/                                         |
+---------------------------------+----------------------------------------------------------+

Fixes: #536

This change adds 2 new options to gitea forge endpoints:

* Tools metadata URL
* Use internal tools URLs

By default, GARM looks in the releases page of the gitea arc_runner
to determine where it can download the runner binary from for a particular
OS/arch. The tools metadata URL option can be set on an endpoint and can point
to a mirror of the upstream repo. The requirement is that the asset names
exactly mirror upstream naming conventions.

The second option disables GARM calling out to the tools metadata URL entirely.
GARM has some hardcoded values for nightly binaries. If this option is checked,
GARM will use those values, without making any kind of outgoing API call to
determine availability. This is useful in air-gapped environments.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira merged commit 5fdb69a into cloudbase:main Sep 26, 2025
4 checks passed
@gabriel-samfira gabriel-samfira deleted the allow-static-tools branch September 26, 2025 15:59
Comment on lines +184 to +193
if err != nil {
slog.ErrorContext(ctx, "failed to get tools from metadata URL", "error", err)
if metadataURL != appdefaults.GiteaRunnerReleasesURL {
slog.InfoContext(ctx, "attempting to get tools from default upstream", "tools_url", appdefaults.GiteaRunnerReleasesURL)
latest, err = getReleasesFromURL(ctx, metadataURL)
if err != nil {
return nil, fmt.Errorf("failed to get upstream tools: %w", err)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a bug. err is not returned if metadataURL == appdefaults.GiteaRunnerReleasesURL .

Copy link
Member Author

Choose a reason for hiding this comment

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

quite right. Addressed in #543

Copy link
Member Author

Choose a reason for hiding this comment

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

nightly image is building with the above mentioned patch.

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.

Options for tools provisioning

2 participants