Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

stage1-implementors-guide.md: Add filesystem layout assumptions. #1832

Merged
merged 1 commit into from Jan 12, 2016

Conversation

yifan-gu
Copy link
Contributor

@yifan-gu yifan-gu commented Dec 3, 2015


### opt/stage2

As mentioned above, in rkt, the apps will be executed during stage2. rkt expects the directory path `opt/stage2` to exist under the stage1 rootfs. This directory is used by stage0 to extract the app's ACI. `rkt gc` also expects the app's rootfs to be mounted under this directory when overlayfs is used (e.g. `/var/lib/rkt/pods/$uuid/stage1/rootfs/opt/stage2/$appname/rootfs`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence per line for now please

### opt/stage2

As mentioned above, in rkt, the apps will be executed during stage2.
rkt expects the directory path `opt/stage2` to exist under the stage1 rootfs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually created by stage0:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iaguis: So it looks like I can drop the creation of the /opt/stage2 directory tree from the build system, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we probably still have to write something about /opt/stage2 directories being created by rkt, so stage1 implementation shouldn't have any file named stage2 in /opt directory. Or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iaguis @krnowak OK, then can we create /rkt/status /rkt/env in stage0 as well?
The error @steveej got is from
https://github.com/coreos/rkt/blob/master/stage0/run.go#L641

Seems it's because /rkt directory does not exist.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krnowak
Copy link
Collaborator

krnowak commented Dec 7, 2015

Small nit and needs a rebase.

@yifan-gu
Copy link
Contributor Author

Updated @krnowak @iaguis


This directory path is used for extracting the app's ACI.
`rkt gc` also expects the app's rootfs to be mounted under this directory when
overlayfs is used (e.g. `/var/lib/rkt/pods/$uuid/stage1/rootfs/opt/stage2/$appname/rootfs`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True at the moment, but rkt gc will soon not expect this anymore with #1856.

/cc @steveej

@alban alban modified the milestones: v0.15.0, v0.14.0 Dec 18, 2015
@alban alban modified the milestones: v0.16.0, v0.15.0 Jan 7, 2016
@yifan-gu
Copy link
Contributor Author

yifan-gu commented Jan 8, 2016

@alban Addressed comments.


### rkt/env

This directory path is used for passing the environments to each app.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the environment" or "environment variables"

This directory path is used for storing the apps' exit statuses.
For example, if an app named `foo` exits with status = `42`, stage1 should write `42`
in `/var/lib/rkt/pods/$state/$uuid/stage1/rootfs/rkt/status/foo`.
Later the exit status will be fetch and shown by `rkt status $uuid`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/will/can/
s/fetch/retrieved/
trailing full-stop

@jonboulle
Copy link
Contributor

A few comments, LGTM after that.

@yifan-gu
Copy link
Contributor Author

@jonboulle Thanks! Fixed !

## Filesystem Layout Assumptions

The following paths are reserved for the stage1 image, and they will be created during stage0.
Users **SHOULD NOT** create or use these paths when making a stage1 image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yifan-gu sorry my comment here seems to have been lost. I'm a little wary of the word "Users" as I don't want to mislead anyone - I suggest a slight tweak:

When creating a stage1 image, developers SHOULD NOT create or use these paths in the image's filesystem

@yifan-gu
Copy link
Contributor Author

Suggest: Renumber this list to be index-1. (I believe markdown will render it index-1 in HTML, anyway)

I didn't follow this one @joshix

@yifan-gu
Copy link
Contributor Author

@joshix Fixed other comments. Replace stage1 with stage 1 in the paragraph. Add $state(run/prepare) in the path.

@joshix
Copy link
Contributor

joshix commented Jan 12, 2016

@yifan-gu I was suggesting that you number your list as 1, 2, 3, 4 (index 1), rather than starting with 0.

Notice that the markdown 0, 1, 2, 3, will be rendered as a list beginning with 1 in the HTML presentation. See below:

  1. Typed 0.
  2. Typed 1.
  3. Typed 2.
  4. Typed 8. Ha!

@yifan-gu
Copy link
Contributor Author

@joshix Gotcha, fixed.

Also replace " with ` for more clearness.
@joshix
Copy link
Contributor

joshix commented Jan 12, 2016

LGTM

alban added a commit that referenced this pull request Jan 12, 2016
stage1-implementors-guide.md: Add filesystem layout assumptions.
@alban alban merged commit dd2255a into rkt:master Jan 12, 2016
@yifan-gu yifan-gu deleted the doc_stage1_rkt_dir branch January 12, 2016 19:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants