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

Conversation

@yifan-gu
Copy link
Contributor

Add ability to patch the app during rkt app add.
Ref #3136
#3010

@yifan-gu yifan-gu added this to the vCRI milestone Sep 16, 2016
@alban
Copy link
Member

alban commented Sep 16, 2016

I would prefer if the flags for rkt run myapp --myflags don't diverge too much from rkt app add UUID myapp --myflags. I started to add flags for #3203 and I would like to reuse existing code for most of the flags if not all (--memory=, etc.)

The new flags here --name=, --annotation= seem useful for both rkt run myapp and rkt app add UUID myapp.

/cc @krnowak

@s-urbaniak
Copy link
Contributor

@alban @yifan-gu I agree that we should these flags also to rkt run.

@yifan-gu
Copy link
Contributor Author

yifan-gu commented Sep 16, 2016

Blocked by #3209

@monder
Copy link

monder commented Sep 19, 2016

@s-urbaniak That would finally fix #1204. Really waiting for that.

Or its better to create a separate PR just for the app name, that won't add new functionality so we can merge it sooner. I'm not sure what vCRI is.

@lucab
Copy link
Member

lucab commented Sep 19, 2016

@yifan-gu #3209 just landed :)

@monder vCRI is a working branch/milestone to support the new Kubernetes runtime interface in rkt. That branch is quite experimental so it is not meant to be used by final users, but fixes there will definitely land in master soon.

@yifan-gu
Copy link
Contributor Author

Updating.

@yifan-gu
Copy link
Contributor Author

Actually blocking on #3207 But I will make updates based on that.

@s-urbaniak s-urbaniak modified the milestones: v1.17.0, vCRI Sep 20, 2016
@yifan-gu yifan-gu force-pushed the cri_patch branch 3 times, most recently from ef8492a to 91f015c Compare September 22, 2016 00:05
@yifan-gu yifan-gu changed the title CRI: Patch app name, app annotation during rkt app add. CRI: Add '--name', '--annotation', '--label', '--environment' for 'rkt app add'. Sep 22, 2016
@yifan-gu
Copy link
Contributor Author

Now after rebase, I can patch environment, annotation, label, name for the app:

$ sudo rkt app add 65bb11a9 sha512-f94f7a2d3f28 --annotation=foo=bar --annotation=hello=world --label=bar=foo --label=world=hello --environment=foo=bar --exec="/bin/sleep 1000" --name=test
...
$ sudo rkt app status 65bb11a9 --app=test --format=json-pretty
{
    "name": "test",
    "state": "created",
    "created_at": 1474502683,
    "image_id": "sha512-f94f7a2d3f289edaf18fe125ab8850e1f0bf703148b0cf2d3bb3c3f78efea6dd",
    "cri_annotations": {
        "foo": "bar",
        "hello": "world"
    },
    "cri_labels": {
        "bar": "foo",
        "world": "hello"
    }
}

$ sudo rkt cat-manifest --pretty-print 65bb11a9
{
    "acVersion": "1.15.0+git117aaa9-dirty",
    "acKind": "PodManifest",
    "apps": [
        {
            "name": "test",
            "image": {
                "name": "registry-1.docker.io/library/busybox",
                "id": "sha512-f94f7a2d3f289edaf18fe125ab8850e1f0bf703148b0cf2d3bb3c3f78efea6dd",
                "labels": [
                    {
                        "name": "version",
                        "value": "latest"
                    },
                    {
                        "name": "arch",
                        "value": "amd64"
                    },
                    {
                        "name": "os",
                        "value": "linux"
                    }
                ]
            },
            "app": {
                "exec": [
                    "/bin/sleep 1000"
                ],
                "user": "0",
                "group": "0",
                "environment": [
                    {
                        "name": "PATH",
                        "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                    },
                    {
                        "name": "foo",
                        "value": "bar"
                    }
                ],
                "criAnnotations": {
                    "foo": "bar",
                    "hello": "world"
                },
                "criLabels": {
                    "bar": "foo",
                    "world": "hello"
                }
            }
        }
    ],
    "volumes": null,
    "isolators": null,
    "annotations": [
        {
            "name": "coreos.com/rkt/stage1/mutable",
            "value": "true"
        }
    ],
    "ports": []
}

Also environment is set correctly:

$ sudo rkt enter 65bb11a9 env
HOME=/root
SHELL=/bin/sh
USER=root
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
foo=bar
AC_APP_NAME=test
TERM=xterm

@yifan-gu
Copy link
Contributor Author

yifan-gu commented Sep 22, 2016

Same failure again

00:56:03 === RUN   TestNetDefaultRestrictedConnectivity
00:56:08 --- FAIL: TestNetDefaultRestrictedConnectivity (5.55s)

Ref #2943

@monder
Copy link

monder commented Sep 22, 2016

@yifan-gu Awesome. Could you please double check that it resolves #1204 and works with run command
From the code perspective it should, but just to be sure.

rkt run sha512-f94f7a2d3f28 --name test1 sha512-f94f7a2d3f28 --name test2

It should result in pod running two instances of the same app.

@yifan-gu
Copy link
Contributor Author

@monder This PR only address rkt app add, but I made another one (#3236) to change rkt run/prepare as well.

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.

5 participants