-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial support for Compose Build spec
The idea is we generate a systemd (one-shot) service per build that users can run _manually_ to build the container and add it to the runtime's image store. Users can also pass in `-build=true` to enable the build service to run as a dependency for the container. However, keeping this config would result in a _new_ build on every restart of the system (or root target), which would implicitly result in an update of the container. For now, we do not support Git repo build contexts (i.e., pull from repo before building).
- Loading branch information
Showing
13 changed files
with
643 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
systemd.services."{{.Runtime}}-build-{{.ServiceName}}" = { | ||
{{- /* TODO: Support Git repo as a build source. */}} | ||
path = [ pkgs.{{.Runtime}} pkgs.git ]; | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
{{- if cfg.Build}} | ||
RemainAfterExit = true; | ||
{{- end}} | ||
}; | ||
script = '' | ||
cd {{.Context}} | ||
{{escapeIndentedNixString .Command}} | ||
''; | ||
{{- if and cfg.Build rootTarget}} | ||
partOf = [ "{{rootTarget}}.target" ]; | ||
wantedBy = [ "{{rootTarget}}.target" ]; | ||
{{- end}} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Adapted from: https://github.com/ente-io/ente/blob/main/server/compose.yaml | ||
services: | ||
museum: | ||
build: | ||
context: . | ||
args: | ||
GIT_COMMIT: development-cluster | ||
tags: | ||
- latest | ||
- non-latest | ||
ports: | ||
- 8080:8080 # API | ||
- 2112:2112 # Prometheus metrics | ||
environment: | ||
# Pass-in the config to connect to the DB and MinIO | ||
ENTE_CREDENTIALS_FILE: /credentials.yaml | ||
volumes: | ||
- custom-logs:/var/logs | ||
- ./museum.yaml:/museum.yaml:ro | ||
- ./scripts/compose/credentials.yaml:/credentials.yaml:ro | ||
- ./data:/data:ro | ||
networks: | ||
- internal | ||
|
||
volumes: | ||
custom-logs: | ||
|
||
networks: | ||
internal: |
Oops, something went wrong.