Skip to content

Commit ba32dab

Browse files
committed
projects: add ORAS proposal
Signed-off-by: Josh Dolitsky <[email protected]>
1 parent c5cbfa7 commit ba32dab

File tree

2 files changed

+197
-0
lines changed

2 files changed

+197
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ https://groups.google.com/a/opencontainers.org/forum/#!forum/tob (tob@opencontai
2626
* [Image Format Spec](proposals/image-format)
2727
* [SELinux](proposals/selinux.md)
2828
* [Tools](proposals/tools.md)
29+
* [ORAS](proposals/oras.md)
2930

3031
## Voting
3132

proposals/oras.md

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# OCI ORAS Project Proposal #
2+
3+
## Abstract ##
4+
5+
The [ORAS project][oras-project] is a CLI that can publish arbitrary content to an OCI registry, with special features for setting mediatypes on manifest configs and on content.
6+
7+
In order to provide OCI end users a method to publish and retrieve any type of content to/from an OCI registry, as well as a reference implementation for the in-progress artifacts spec, ORAS should be moved under the opencontainers GitHub org.
8+
9+
[oras-project]: https://github.com/deislabs/oras
10+
11+
### ORAS Details ###
12+
13+
ORAS is a CLI that can publish arbitrary content to an OCI registry, with special features for setting mediatypes on manifest configs and on content.
14+
15+
Note: the manifest mediatype itself is always `application/vnd.oci.image.manifest.v1+json`.
16+
17+
Example - uploading rockets, a brand new type of package:
18+
19+
```
20+
# Create a thing
21+
printf '🚀' > rocket.txt
22+
23+
# Create a manifest config
24+
printf '{"RocketVersion":"v0.1.0"}' > rocket-config.json
25+
26+
# Upload your thing with a custom mediatype
27+
oras push localhost:5000/mystuff/myrocket:v0.1.0 rocket.txt:text/plain \
28+
--manifest-config rocket-config.json:application/vnd.acme.rocket.config.v1+json
29+
```
30+
31+
See manifest created:
32+
33+
```
34+
$ curl -s -H 'Accept: application/vnd.oci.image.manifest.v1+json' \
35+
http://localhost:5000/v2/mystuff/myrocket/manifests/v0.1.0 | jq
36+
{
37+
"schemaVersion": 2,
38+
"config": {
39+
"mediaType": "application/vnd.acme.rocket.config.v1+json",
40+
"digest": "sha256:310175f34d2d4d5cba3418be06ddd1ef948147d729516d78318ec7f5c2d83d49",
41+
"size": 26
42+
},
43+
"layers": [
44+
{
45+
"mediaType": "text/plain",
46+
"digest": "sha256:ebbc0b2870eb323f2b6cffa5c493ceef81ae7eb36afc73d4e0367301631daec5",
47+
"size": 4,
48+
"annotations": {
49+
"org.opencontainers.image.title": "rocket.txt"
50+
}
51+
}
52+
]
53+
}
54+
```
55+
56+
Get that thing:
57+
58+
```
59+
$ curl -s http://localhost:5000/v2/mystuff/myrocket/blobs/sha256:ebbc0b2870eb323f2b6cffa5c493ceef81ae7eb36afc73d4e0367301631daec5
60+
🚀
61+
```
62+
63+
#### Additional Usage ####
64+
65+
ORAS is built primarily on top of Go packages provided by [containerd][containerd-project], but it also imports packages from the [docker/cli][dockercli-project], which enables "docker-style" auth login:
66+
67+
```
68+
oras login -u username -p password localhost:5000 -c rocket-creds.json
69+
```
70+
71+
There are also public Go packages available to build on top of ORAS. The following is the equivalent of the rocket example with the CLI above, but in Go:
72+
73+
```go
74+
package main
75+
76+
import (
77+
"context"
78+
"fmt"
79+
80+
"github.com/containerd/containerd/remotes/docker"
81+
"github.com/deislabs/oras/pkg/content"
82+
"github.com/deislabs/oras/pkg/oras"
83+
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
84+
)
85+
86+
func main() {
87+
ctx := context.Background()
88+
resolver := docker.NewResolver(docker.ResolverOptions{})
89+
store := content.NewMemoryStore()
90+
91+
registryRootURL := "localhost:5000"
92+
registryNamespace := "mystuff/myrocket"
93+
94+
rocketVersion := "v0.1.0"
95+
rocketFileName := "rocket.txt"
96+
rocketMediaType := "text/plain"
97+
rocketContent := []byte("🚀")
98+
rocketDescriptor := store.Add(rocketFileName, rocketMediaType, rocketContent)
99+
100+
rocketConfigMediaType := "application/vnd.acme.rocket.config.v1+json"
101+
rocketConfigContent := []byte(fmt.Sprintf("{\"RocketVersion\":\"%s\"}", rocketVersion))
102+
rocketConfigDescriptor := store.Add("", rocketConfigMediaType, rocketConfigContent)
103+
104+
ref := fmt.Sprintf("%s/%s:%s", registryRootURL, registryNamespace, rocketVersion)
105+
_, err := oras.Push(ctx, resolver, ref, store, []ocispec.Descriptor{rocketDescriptor},
106+
oras.WithConfig(rocketConfigDescriptor))
107+
if err != nil {
108+
panic(err)
109+
}
110+
111+
fmt.Println("Pushed to", ref)
112+
fmt.Printf("\nTry:\n\ncurl -s -H 'Accept: application/vnd.oci.image.manifest.v1+json' \\\n" +
113+
" %s/v2/%s/manifests/%s | jq\n", registryRootURL, registryNamespace, rocketVersion)
114+
}
115+
```
116+
117+
You can see all features in the project [README][oras-readme].
118+
119+
[containerd-project]: https://github.com/containerd/containerd
120+
[dockercli-project]: https://github.com/docker/cli
121+
[oras-readme]: https://github.com/deislabs/oras/blob/master/README.md
122+
123+
#### Adoption ####
124+
125+
The following projects are already successfully using ORAS to work with custom artifacts:
126+
127+
- [Helm][helm-usage]
128+
- [Conftest][conftest-usage]
129+
- [Singularity][singularity-usage]
130+
131+
[helm-usage]: https://github.com/helm/helm/search?q=oras
132+
[conftest-usage]: https://github.com/instrumenta/conftest/search?q=oras
133+
[singularity-usage]: https://github.com/sylabs/singularity/search?q=oras
134+
135+
## Proposal ##
136+
Change the ownership of the existing ORAS project from deislabs:
137+
138+
https://github.com/deislabs/oras
139+
140+
And move it inside the `opencontainers` organization:
141+
142+
https://github.com/opencontainers/oras
143+
144+
The import paths will correspondingly be "github.com/opencontainers/oras" (oras does have some Go API users, but since the project will be renamed -- and GitHub will add a redirect -- there will be no significant downstream impact of the change).
145+
146+
### Initial Maintainers ###
147+
Initial maintainers of the ORAS project would be:
148+
149+
* Josh Dolitsky <[email protected]> (@jdolitsky)
150+
* Shiwei Zhang <[email protected]> (@shizhMSFT)
151+
* Sajay Antony <[email protected]> (@sajayantony)
152+
* Steve Lasker <[email protected]> (@stevelasker)
153+
* Jimmy Zelinskie <[email protected]> (@jzelinskie)
154+
* Matt Fisher <[email protected]> (@bacongobbler)
155+
156+
### Code of Conduct ###
157+
This project would incorporate (by reference) the OCI [Code of Conduct][code-of-conduct].
158+
159+
[code-of-conduct]: https://github.com/opencontainers/org/blob/master/CODE_OF_CONDUCT.md
160+
161+
### Governance and Releases ###
162+
This project would incorporate the Governance and Releases processes from the [OCI project template][oci-project-template].
163+
164+
It should be noted that since ORAS is not a specification, it is not bound by the ordinary quorum and voting rules for specification release.
165+
As such, new versions will be released as regularly as needed without the need for a quorum vote.
166+
167+
Pull requests will require two (2) reviews (signified by "LGTM") from project maintainers.
168+
Maintainers are not allowed to review a pull request which they authored.
169+
170+
[oci-project-template]: https://github.com/opencontainers/project-template
171+
172+
### Project Communications ###
173+
The proposed project would continue to use existing channels in use by the OCI developer community for communication including:
174+
175+
* GitHub for issues and pull requests.
176+
* The [`[email protected]`][oci-ml] email list.
177+
* The weekly OCI developer community conference call.
178+
* The `#opencontainers` IRC channel on Freenode.
179+
* The [OCI Slack workspace][oci-slack].
180+
* The [OCI Matrix Room][oci-matrix].
181+
182+
[oci-ml]: mailto:[email protected]
183+
[oci-slack]: https://opencontainers.slack.com/
184+
[oci-matrix]: https://matrix.to/#/#opencontainers:matrix.org
185+
186+
## Frequently Asked Questions (FAQ)
187+
*Q: Does this change the OCI Charter or Scope Table?*
188+
A: Yes, this will add an additional row to the [OCI Scope Table][oci-scope-table], which does not currently include any mention of generic OCI image tooling.
189+
This proposal does not intend to amend the [OCI Charter][oci-charter].
190+
191+
[oci-scope-table]: https://www.opencontainers.org/about/oci-scope-table
192+
[oci-charter]: https://www.opencontainers.org/about/governance
193+
194+
*Q: Who are the other target users of ORAS?*
195+
A: Users seeking a common way to store different types of content (not just container images),
196+
using the OCI Distribution Spec as the baseline API.

0 commit comments

Comments
 (0)