Skip to content

Commit 38cbfc9

Browse files
committed
Merge branch 'master' into add-vm-config
2 parents 0246778 + c26f07c commit 38cbfc9

16 files changed

Lines changed: 454 additions & 189 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
output
22
schema/validate
3+
code-of-conduct.md
4+
version.md

.pullapprove.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
approve_by_comment: true
2+
approve_regex: ^LGTM
3+
reject_regex: ^Rejected
4+
reset_on_push: true
5+
reviewers:
6+
teams:
7+
- runtime-spec-maintainers
8+
name: default
9+
required: 2

.tool/version-doc.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"fmt"
7+
"html/template"
8+
"os"
9+
10+
"github.com/opencontainers/runtime-spec/specs-go"
11+
)
12+
13+
var markdownTemplateString = `
14+
15+
**Specification Version:** *{{.}}*
16+
17+
`
18+
19+
var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString))
20+
21+
func main() {
22+
if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil {
23+
fmt.Fprintln(os.Stderr, err)
24+
}
25+
}

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ go:
66
sudo: false
77

88
before_install:
9-
- go version | (grep -q 'go1.[56]' || exit 0 && go get -u github.com/golang/lint/golint )
10-
- go get -u github.com/vbatts/git-validation
9+
- make install.tools
1110

1211
install: true
1312

1413
script:
15-
- go vet -x ./...
14+
- make .govet
1615
- make .golint
17-
- git-validation -run DCO,short-subject,dangling-whitespace -v
16+
- make .gitvalidation
1817

Makefile

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11

2-
DOCKER ?= $(shell which docker)
2+
SHELL ?= $(shell command -v bash 2>/dev/null)
3+
DOCKER ?= $(shell command -v docker 2>/dev/null)
4+
PANDOC ?= $(shell command -v pandoc 2>/dev/null)
5+
ifeq "$(strip $(PANDOC))" ''
6+
ifneq "$(strip $(DOCKER))" ''
7+
PANDOC = $(DOCKER) run \
8+
-it \
9+
--rm \
10+
-v $(shell pwd)/:/input/:ro \
11+
-v $(shell pwd)/output/:/output/ \
12+
-u $(shell id -u) \
13+
vbatts/pandoc
14+
PANDOC_SRC := /input/
15+
PANDOC_DST := /
16+
endif
17+
endif
18+
319
# These docs are in an order that determines how they show up in the PDF/HTML docs.
420
DOC_FILES := \
21+
version.md \
522
README.md \
623
code-of-conduct.md \
724
principles.md \
@@ -14,34 +31,33 @@ DOC_FILES := \
1431
runtime-linux.md \
1532
config.md \
1633
config-linux.md \
34+
config-solaris.md \
1735
glossary.md
18-
EPOCH_TEST_COMMIT := 041eb73d2e0391463894c04c8ac938036143eba3
36+
EPOCH_TEST_COMMIT := 78e6667ae2d67aad100b28ee9580b41b7a24e667
37+
38+
default: docs
1939

20-
docs: pdf html
2140
.PHONY: docs
41+
docs: output/docs.pdf output/docs.html
2242

23-
pdf:
24-
@mkdir -p output/ && \
25-
$(DOCKER) run \
26-
-it \
27-
--rm \
28-
-v $(shell pwd)/:/input/:ro \
29-
-v $(shell pwd)/output/:/output/ \
30-
-u $(shell id -u) \
31-
vbatts/pandoc -f markdown_github -t latex -o /output/docs.pdf $(patsubst %,/input/%,$(DOC_FILES)) && \
32-
ls -sh $(shell readlink -f output/docs.pdf)
33-
34-
html:
35-
@mkdir -p output/ && \
36-
$(DOCKER) run \
37-
-it \
38-
--rm \
39-
-v $(shell pwd)/:/input/:ro \
40-
-v $(shell pwd)/output/:/output/ \
41-
-u $(shell id -u) \
42-
vbatts/pandoc -f markdown_github -t html5 -o /output/docs.html $(patsubst %,/input/%,$(DOC_FILES)) && \
43-
ls -sh $(shell readlink -f output/docs.html)
43+
ifeq "$(strip $(PANDOC))" ''
44+
output/docs.pdf output/docs.html:
45+
$(error cannot build $@ without either pandoc or docker)
46+
else
47+
output/docs.pdf: $(DOC_FILES)
48+
mkdir -p output/ && \
49+
$(PANDOC) -f markdown_github -t latex -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES))
50+
51+
output/docs.html: $(DOC_FILES)
52+
mkdir -p output/ && \
53+
$(PANDOC) -f markdown_github -t html5 -o $(PANDOC_DST)$@ $(patsubst %,$(PANDOC_SRC)%,$(DOC_FILES))
54+
endif
4455

56+
code-of-conduct.md:
57+
curl -o $@ https://raw.githubusercontent.com/opencontainers/tob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md
58+
59+
version.md: ./specs-go/version.go
60+
go run ./.tool/version-doc.go > $@
4561

4662
HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
4763
# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
@@ -53,19 +69,47 @@ test: .govet .golint .gitvalidation
5369

5470
# `go get golang.org/x/tools/cmd/vet`
5571
.govet:
72+
@go tool | grep -qw vet || (echo "ERROR: 'go vet' not found. Consider 'make install.tools' target" && false)
5673
go vet -x ./...
5774

5875
# `go get github.com/golang/lint/golint`
5976
.golint:
6077
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
78+
@which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false)
6179
golint ./...
6280
endif
6381

6482

65-
# `go get github.com/vbatts/git-validation`
83+
# When this is running in travis, it will only check the travis commit range
6684
.gitvalidation:
67-
git-validation -q -run DCO,short-subject -v -range $(EPOCH_TEST_COMMIT)..HEAD
85+
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
86+
ifeq ($(TRAVIS),true)
87+
git-validation -q -run DCO,short-subject,dangling-whitespace
88+
else
89+
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
90+
endif
91+
92+
93+
.PHONY: install.tools
94+
install.tools: .install.golint .install.govet .install.gitvalidation
95+
96+
# golint does not even build for <go1.5
97+
.install.golint:
98+
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
99+
go get github.com/golang/lint/golint
100+
endif
101+
102+
# go vet is now included in >=go1.5, so no need to get it.
103+
.install.govet:
104+
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
105+
go get golang.org/x/tools/cmd/vet
106+
endif
107+
108+
.install.gitvalidation:
109+
go get github.com/vbatts/git-validation
110+
68111

112+
.PHONY: clean
69113
clean:
70114
rm -rf output/ *~
71115

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ The [Open Container Initiative](http://www.opencontainers.org/) develops specifi
66
Table of Contents
77

88
- [Introduction](README.md)
9-
- [Code of Conduct](code-of-conduct.md)
9+
- [Code of Conduct](#code-of-conduct)
1010
- [Container Principles](principles.md)
1111
- [Style and Conventions](style.md)
1212
- [Roadmap](ROADMAP.md)
1313
- [Implementations](implementations.md)
1414
- [project](project.md)
1515
- [Filesystem Bundle](bundle.md)
16-
- [Runtime and Lifecycle](runtime.md)
17-
- [Linux Specific Runtime](runtime-linux.md)
16+
- Runtime and Lifecycle
17+
- [General Runtime and Lifecycle](runtime.md)
18+
- [Linux-specific Runtime and Lifecycle](runtime-linux.md)
1819
- Configuration
19-
- [General](config.md)
20-
- [Linux-specific](config-linux.md)
20+
- [General Configuration](config.md)
21+
- [Linux-specific Configuration](config-linux.md)
22+
- [Solaris-specific Configuration](config-solaris.md)
2123
- [Glossary](glossary.md)
2224

2325
In the specifications in the above table of contents, the keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in [RFC 2119](http://tools.ietf.org/html/rfc2119) (Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997).
@@ -54,11 +56,11 @@ During the `0.x` series of OCI releases we make no backwards compatibility guara
5456
Development happens on GitHub for the spec.
5557
Issues are used for bugs and actionable items and longer discussions can happen on the [mailing list](#mailing-list).
5658

57-
The specification and code is licensed under the Apache 2.0 license found in the `LICENSE` file of this repository.
59+
The specification and code is licensed under the Apache 2.0 license found in the [LICENSE](./LICENSE) file.
5860

5961
## Code of Conduct
6062

61-
Participation in the OpenContainers community is governed by [OpenContainer's Code of Conduct](https://github.com/opencontainers/tob/blob/master/code-of-conduct.md).
63+
Participation in the OpenContainers community is governed by [OpenContainer's Code of Conduct](https://github.com/opencontainers/tob/blob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md).
6264

6365
## Discuss your design
6466

ROADMAP.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,6 @@ Listed topics may defer to the [project wiki](https://github.com/opencontainers/
1010

1111
## 1.0
1212

13-
### Digest and Hashing
14-
15-
A bundle is designed to be moved between hosts.
16-
Although OCI doesn't define a transport method we should have a cryptographic digest of the on-disk bundle that can be used to verify that a bundle is not corrupted and in an expected configuration.
17-
18-
*Owner:* philips
19-
20-
### Define Container Lifecycle
21-
22-
Containers have a lifecycle and being able to identify and document the lifecycle of a container is very helpful for implementations of the spec.
23-
The lifecycle events of a container also help identify areas to implement hooks that are portable across various implementations and platforms.
24-
25-
*Owner:* mrunalp
26-
27-
### Define Standard Container Actions (Target release: v0.3.0)
28-
29-
Define what type of actions a runtime can perform on a container without imposing hardships on authors of platforms that do not support advanced options.
30-
31-
*Owner:* duglin
32-
3313
### Container Definition
3414

3515
Define what a software container is and its attributes in a cross platform way.
@@ -46,18 +26,6 @@ Proposal: make it an optional feature
4626

4727
*Owner:* hqhq (was vishh) robdolinms, bcorrie
4828

49-
### Validation Tooling (Target release: v0.3.0)
50-
51-
Provide validation tooling for compliance with OCI spec and runtime environment.
52-
53-
*Owner:* mrunalp
54-
55-
### Testing Framework
56-
57-
Provide a testing framework for compliance with OCI spec and runtime environment.
58-
59-
*Owner:* liangchenye
60-
6129
### Version Schema
6230

6331
Decide on a robust versioning schema for the spec as it evolves.
@@ -66,16 +34,6 @@ Resolved but release process could evolve. Resolved for v0.2.0, expect to revisi
6634

6735
*Owner:* vbatts
6836

69-
### Printable/Compiled Spec
70-
71-
Regardless of how the spec is written, ensure that it is easy to read and follow for first time users.
72-
73-
Part of this is resolved. Produces an html & pdf.
74-
Done
75-
Would be nice to publish to the OCI web site as part of our release process.
76-
77-
*Owner:* vbatts
78-
7937
### Base Config Compatibility
8038

8139
Ensure that the base configuration format is viable for various platforms.
@@ -95,9 +53,3 @@ Ensure that we have lifecycle hooks in the correct places with full coverage ove
9553
Will probably go away with Vish's work on splitting create and start, and if we have exec.
9654

9755
*Owner:*
98-
99-
### Distributable Format
100-
101-
A common format for serializing and distributing bundles.
102-
103-
*Owner:* vbatts

code-of-conduct.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

config-linux.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Linux-specific Container Configuration
22

3+
This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md).
34
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and file system jails to fulfill the spec.
4-
Additional information is needed for Linux over the [default spec configuration](config.md) in order to configure these various kernel features.
55

66
## Default File Systems
77

@@ -88,7 +88,7 @@ Also, when a path is specified, a runtime MUST assume that the setup for that pa
8888
```
8989

9090
uid/gid mappings describe the user namespace mappings from the host to the container.
91-
The mappings represent how the bundle `rootfs` expects the user namespace to be setup and the runtime SHOULD NOT modify the permissions on the rootfs to realize the mapping.
91+
The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
9292
*hostID* is the starting uid/gid on the host to be mapped to *containerID* which is the starting uid/gid in the container and *size* refers to the number of ids to be mapped.
9393
There is a limit of 5 mappings which is the Linux kernel hard limit.
9494

0 commit comments

Comments
 (0)