Comments (8)
Thank You! Got it working at #2254! :-)
from spin.
The first approach (new section in spin.toml, support for overriding at time of publish) brings a host of design/UX questions as this would be the first instance of capturing registry/publishing-related data in a Spin app's build document. I can imagine some other values that may be handy to store there (or near) like a default registry reference, etc... but all of this is to say that it probably warrants a wider discussion (and perhaps a SIP?)
I'd also be curious if the latter approach (publish-time metadata injection) might suffice for the needs here? Would the metadata be used in any other registry commands besides spin registry push
(eg inspection somehow on spin registry pull
?) Or would the metadata mostly just be informational?
from spin.
Let me see if I can elicit a scope / functional spec here, because I am not sure how closely this needs to follow Docker.
To literally follow Docker we would need:
- A persistent way to define metadata slots with fixed or parameterised values (the equivalent of the LABEL statements), e.g. in
spin.toml
- A way to set the parameterised values at push time, e.g. arguments to
spin registry push
But another approach would be:
- A way to define metadata at push time (no persistent slots), e.g.
spin registry push --metadata org.opencontainers.image.license=mylicence
The latter would be considerably easier; admittedly the UI would be less convenient but maybe this is mostly done from CI where it doesn't matter?
from spin.
For my particular case, the metadata is informational only, and a push time only way is enough. I do not have enough experience to comment about other use cases.
PS I'm also not sure how to name the argument. Whether it should be metadata, annotation, label, or something else. Maybe its name should be aligned with the oci image artifact specification?
from spin.
FWIW, In the context of the OCI image spec, the correct name seems to the annotations instead of metadata. So probably, should be implemented as, e.g.:
spin registry push \
--annotation org.opencontainers.image.description="Example Spin HTTP Application written in TypeScript" \
--annotation org.opencontainers.image.licenses="ISC"
An example of the image can be seen at https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest, which boils down to:
{
"annotations": {
"com.example.key1": "value1",
"com.example.key2": "value2"
}
}
from spin.
BTW, if you point me in the right direction, I would like to try to implement this :-)
from spin.
@rgl the --annotation
approach sounds good to me. Thanks for volunteering to take a look at implementing!
-
The
spin registry push
command logic starts here: https://github.com/fermyon/spin/blob/main/src/commands/registry.rs#L30 -
Check out the oci crate for all oci/registry-related logic. Specifically, here's where we currently build the OCI image manifest during push -- and right now are supplying
None
for the optional annotations HashMap: https://github.com/fermyon/spin/blob/main/crates/oci/src/client.rs#L190
Let us know if we can be of further help.
from spin.
Shared a suggestion in #2259 for this.
Thank you for your work, @rgl!
from spin.
Related Issues (20)
- spin watch doesn't rebuild/reconfigure on manifest file changes HOT 6
- Different execution times for python spin app on local machine and Fermyon Cloud HOT 6
- Sleeping in a Spin app breaks traces HOT 1
- Templates: support Cargo workspaces
- Upcoming Security Release of Spin (GHSA-f3h7-gpjj-wcvh) HOT 1
- Support exporting application logs through OTel HOT 2
- spin-v2.4.3-macos-amd64.tar.gz contains the wrong architecture HOT 4
- Template install and upgrade commands use different option for Git/URL.
- Dynamically set service name for OTel resource
- `files` manifest option should warn when `destination` does not appear to be a directory HOT 3
- Consider using `http-acl` for enforcing `allowed-outbound-hosts`
- Enhance React application performance to run on embedded devices. HOT 3
- Received runtime error that should be thrown at component build time HOT 1
- Raspberry Pico HOT 1
- [OTel]: Spans produced by `spin_sdk::key_value::Store::set` don't have a parent assigned HOT 3
- Provide multiple entries as a variable for lists in 'spin.toml' HOT 15
- Add escape syntax to variables expansion syntax (`spin-expressions`) HOT 5
- Provide the ability to import manifest and runtime-config as wasm modules (components) HOT 8
- oci loader related problems with spinkube HOT 3
- Push component to registry HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spin.