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

Refactor rclone-http into a module #108

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

joinemm
Copy link
Collaborator

@joinemm joinemm commented Apr 3, 2024

Replaced copypasted rclone-http services with a reusable module, with configurable options. The caddyfile workaround is also removed as the fix has been merged into nixpkgs and backported to our version.

@joinemm joinemm requested review from flokli, henrirosten and a team April 3, 2024 08:36
hosts/azure/binary-cache/configuration.nix Outdated Show resolved Hide resolved
hosts/azure/builder/configuration.nix Outdated Show resolved Hide resolved
hosts/azure/jenkins-controller/configuration.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Show resolved Hide resolved
services/rclone-http/default.nix Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
hosts/azure/builder/configuration.nix Outdated Show resolved Hide resolved
services/rclone-http/default.nix Outdated Show resolved Hide resolved
flokli
flokli previously approved these changes Apr 4, 2024
Copy link
Collaborator

@henrirosten henrirosten left a comment

Choose a reason for hiding this comment

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

Possibly related to the below comments, in testing this configuration, I see the caddy service on binary-cache VM fails to start with the following error:

Apr 05 05:06:53 ghaf-binary-cache-henrirosten systemd[1]: Starting Caddy...
Apr 05 05:07:03 ghaf-binary-cache-henrirosten caddy[955]: {"level":"info","ts":1712293623.4792607,"msg":"using provided configuration","config_file":"/etc/caddy/caddy_config","config_adapter":"caddyfile"}
Apr 05 05:07:03 ghaf-binary-cache-henrirosten caddy[955]: Error: adapting config using caddyfile: server block without any key is global configuration, and if used, it must be first
Apr 05 05:07:03 ghaf-binary-cache-henrirosten systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 05:07:03 ghaf-binary-cache-henrirosten systemd[1]: caddy.service: Failed with result 'exit-code'.
Apr 05 05:07:03 ghaf-binary-cache-henrirosten systemd[1]: Failed to start Caddy.

Did it work in your tests? I see this error when deploying to a new environment (previously unexisting environment).

@joinemm
Copy link
Collaborator Author

joinemm commented Apr 5, 2024

It seems I removed one line too many when getting rid of the workaround. systemd.services.caddy.serviceConfig.EnvironmentFile = "/var/lib/caddy/caddy.env"; is still needed for the environment variables to load. Caddy service was failing because the $SITE_ADDRESS was empty.

Signed-off-by: Joonas Rautiola <joonas.rautiola@unikie.com>
@joinemm joinemm merged commit 9f1b0dd into tiiuae:main Apr 5, 2024
2 checks passed
@joinemm joinemm deleted the pr-rclone-http-module branch April 5, 2024 12:52
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.

3 participants