-
Notifications
You must be signed in to change notification settings - Fork 0
feat(release): publish a Registry Discovery image #797
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7eac732
feat(release): publish a Registry Discovery image
jeremi 89cf002
docs(site): name the Discovery image in the stability table
jeremi b95fd31
fix(discovery): report the release version from --version
jeremi a0fa79d
fix(release): stage the Discovery binary only from v0.24.0
jeremi 0200227
fix(release): enrol discovery-candidate cleanup with its first candidate
jeremi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,44 @@ | ||
| #![cfg(feature = "server")] | ||
|
|
||
| use std::process::Command; | ||
|
|
||
| fn version_output(flag: &str) -> String { | ||
| let output = Command::new(env!("CARGO_BIN_EXE_discovery")) | ||
| .arg(flag) | ||
| .output() | ||
| .unwrap_or_else(|err| panic!("discovery {flag} runs: {err}")); | ||
|
|
||
| assert!( | ||
| output.status.success(), | ||
| "discovery {flag} failed: {}", | ||
| String::from_utf8_lossy(&output.stderr) | ||
| ); | ||
| String::from_utf8_lossy(&output.stdout).into_owned() | ||
| } | ||
|
|
||
| #[test] | ||
| fn version_output_uses_user_facing_command_name() { | ||
| for flag in ["--version", "-V"] { | ||
| assert_eq!( | ||
| version_output(flag), | ||
| format!( | ||
| "discovery {}\n", | ||
| registry_platform_buildinfo::DISPLAY_VERSION | ||
| ) | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn version_output_marks_a_build_that_is_not_a_release() { | ||
| let expected = if registry_platform_buildinfo::IS_RELEASE_BUILD { | ||
| env!("CARGO_PKG_VERSION").to_owned() | ||
| } else { | ||
| format!("{}-dev", env!("CARGO_PKG_VERSION")) | ||
| }; | ||
|
|
||
| assert_eq!( | ||
| version_output("--version"), | ||
| format!("discovery {expected}\n") | ||
| ); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| # syntax=docker/dockerfile:1.7@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e | ||
|
|
||
| ARG SOURCE_DATE_EPOCH=0 | ||
|
|
||
| FROM debian:trixie-slim@sha256:3a39a0592364683e6bab97937b72cad5a8fa6dcbbee90edb3bb48c7f8e94f258 AS runtime-root | ||
| ARG SOURCE_DATE_EPOCH | ||
|
|
||
| # Discovery serves one immutable index and writes nothing, so the image | ||
| # pre-owns no managed state or audit directory. The runtime file and the index | ||
| # it names are startup-only deployment artifacts mounted read-only together | ||
| # under /etc/registry-discovery: the index path is resolved relative to the | ||
| # runtime file's own directory. | ||
| RUN --mount=type=bind,source=dist/image-bin,target=/workspace/image-bin \ | ||
| --mount=type=bind,source=LICENSE,target=/workspace/LICENSE \ | ||
| mkdir -p \ | ||
| /workspace/runtime-root/etc/registry-discovery \ | ||
| /workspace/runtime-root/licenses/discovery \ | ||
| /workspace/runtime-root/usr/local/bin \ | ||
| && install -m 0755 /workspace/image-bin/discovery /workspace/runtime-root/usr/local/bin/discovery \ | ||
| && install -m 0644 /workspace/LICENSE /workspace/runtime-root/licenses/discovery/LICENSE \ | ||
| && find /workspace/runtime-root -exec touch -h --date="@${SOURCE_DATE_EPOCH}" {} + | ||
|
|
||
| FROM gcr.io/distroless/cc-debian13:nonroot@sha256:d97bc0a941b8d4be647dc0ee75b264ddbb772f1ac5ba690a4309c00723b23775 AS runtime | ||
|
|
||
| LABEL org.registrystack.runtime.uid="65532" \ | ||
| org.registrystack.runtime.gid="65532" | ||
|
|
||
| COPY --from=runtime-root /workspace/runtime-root/ / | ||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| # Discovery serves GET /health for the platform's HTTP probe. The Distroless | ||
| # image has no shell or HTTP client, and Discovery has no healthcheck | ||
| # subcommand. It also reads no environment variable, so the command is what | ||
| # binds the runtime file. | ||
| ENTRYPOINT ["/usr/local/bin/discovery"] | ||
| CMD ["--runtime", "/etc/registry-discovery/runtime.yaml"] |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.