Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image.run(...) #127

Closed
amihaiemil opened this issue May 31, 2018 · 29 comments
Closed

Image.run(...) #127

amihaiemil opened this issue May 31, 2018 · 29 comments
Labels
0.0.2 30min bug Something isn't working

Comments

@amihaiemil
Copy link
Owner

amihaiemil commented May 31, 2018

Image should have the run option, and return the created Container. This will be the equivalent of the docker run IMAGE command.

@amihaiemil amihaiemil added bug Something isn't working 0.0.2 30min labels May 31, 2018
@0crat
Copy link
Collaborator

0crat commented May 31, 2018

Job #127 is now in scope, role is DEV

@0crat
Copy link
Collaborator

0crat commented May 31, 2018

Bug was reported, see §29: +15 point(s) just awarded to @amihaiemil/z

@0crat
Copy link
Collaborator

0crat commented May 31, 2018

The job #127 assigned to @llorllale/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and thiscom.zerocracy.Par@66a4d225

@0crat
Copy link
Collaborator

0crat commented Jun 5, 2018

@llorllale/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@llorllale
Copy link
Contributor

@0crat wait while I try to understand something...

@0crat
Copy link
Collaborator

0crat commented Jun 6, 2018

@0crat wait while I try to understand something... (here)

@llorllale The impediment for #127 was registered successfully by @llorllale/z

@llorllale
Copy link
Contributor

@amihaiemil seems like the JSONs holding the image's metadata don't have a dedicated "name" field. The closest thing I see that we could use is RepoTags, but it's an array. Eg.:

"RepoTags": [
    "example:1.0",
    "example:latest",
    "example:stable"
]

Is the first half of those values always the same?

@amihaiemil
Copy link
Owner Author

amihaiemil commented Jun 8, 2018

@llorllale Yes, I also noticed that, but we add the Name ourselves, when pulling the image, see here

Also, the name of the image is in its URI, as the last segment (but better take it from the Json).
And yes, I believe the first part of the tag is always the name of the Image.

Is this what you asked? :D

@llorllale
Copy link
Contributor

@amihaiemil

Well, yes, but there's no guarantee that it'll be constant.

I just tested:

REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
alpine                           latest              3fd9065eaf02        5 months ago        4.15MB
C:\> docker tag alpine docker-java-api
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
alpine                           latest              3fd9065eaf02        5 months ago        4.15MB
docker-java-api                  latest              3fd9065eaf02        5 months ago        4.15MB

And resulting inspection for alpine reveals:

        "RepoTags": [
            "alpine:latest",
            "docker-java-api:latest"
        ]

@amihaiemil
Copy link
Owner Author

@llorllale I see, but you don't really need that, do you? Since the name is in the Json (we append it manually when pulling the image) and URI anyay. Or you mean something else?

@llorllale
Copy link
Contributor

@amihaiemil as far as I can see, there is no docker run <image> equivalent in the docker api. So I figured this new Image.run() that you're asking for would be a shortcut for Containers.create(image); Container.start();. Or am I wrong?

@amihaiemil
Copy link
Owner Author

amihaiemil commented Jun 12, 2018

@llorllale Yes, exactly, and since RtImage has the name of the Image, it can somehow use RtContainers and create and start a container using its name.

RtImage will get the Containers instance from the encapsulated Docker instance -- I also want to implement this: any object of the API should have a method to return its parent Docker instance. So Image.run() would look something like this (pseudocode):

final Container ctn = this.docker.containers.create(this.name);
ctn.start();
return ctn;

Do you like the idea? Maybe you can start by passing the Docker instance to RtImage and have public method docker()?

@llorllale
Copy link
Contributor

@amihaiemil

Maybe you can start by passing the Docker instance to RtImage and have public method docker()?

Sure.

Now back to my original question.

the name of the image is in its URI, as the last segment (but better take it from the Json)

As I've shown, RepoTags is not really reliable, so I believe the better alternative is to take it from the URI. Do you agree?

@amihaiemil
Copy link
Owner Author

@llorllale Yes, I think the URI is the safest, go with that.

llorllale added a commit to llorllale/docker-java-api that referenced this issue Jun 19, 2018
@llorllale
Copy link
Contributor

@0crat waiting for review/merge of PR #140

@0crat
Copy link
Collaborator

0crat commented Jun 19, 2018

@0crat waiting for review/merge of PR #140 (here)

@llorllale Job #127 is already on hold

@amihaiemil
Copy link
Owner Author

@0crat boost x6

@0crat
Copy link
Collaborator

0crat commented Jun 20, 2018

@0crat boost x6 (here)

@amihaiemil Argument "x6" doesn't match regex \d+x

@amihaiemil
Copy link
Owner Author

@0crat boost 6x

@0crat
Copy link
Collaborator

0crat commented Jun 20, 2018

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@095c162d-96f5-4418-a96c-3a3627c066c0, thread: pool-1135-thread-1
java.util.concurrent.ThreadPoolExecutor$AbortPolicy[2063] java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@48f2798a rejected from java.util.concurrent.ThreadPoolExecutor@7e91cbd3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2432938]

0.22.6: Issue: #127, Comment: 398654937

@amihaiemil
Copy link
Owner Author

@0crat boost 6x

@0crat
Copy link
Collaborator

0crat commented Jun 20, 2018

@0crat boost 6x (here)

@amihaiemil Boost 6x was set for #127

@0crat
Copy link
Collaborator

0crat commented Jun 20, 2018

Boosting tasks is against our principles, see §15: -10 point(s) just awarded to @amihaiemil/z

llorllale added a commit to llorllale/docker-java-api that referenced this issue Jun 20, 2018
As per PR review:
Fixed assertion in RtImageTestCase.runsItselfOk()
amihaiemil added a commit that referenced this issue Jun 21, 2018
@0crat
Copy link
Collaborator

0crat commented Jun 21, 2018

There is an unrecoverable failure on my side. Please, submit it here:

PID: 4@a0cc108b-284c-417e-b3b4-360e68d85261, thread: AsyncFlush-7
com.zerocracy.farm.sync.SyncProject[77] java.lang.IllegalStateException: Failed to acquire "verbosity/llorllale.xml" in "PMO" in 2min: a3e35cd2a8c4/18s/0/2/true/false by QuartzScheduler_Worker-3

0.22.22: CID: 1720734113, Type: "Close job", Author: "amihaiemil"

@0crat
Copy link
Collaborator

0crat commented Jun 21, 2018

The job #127 assigned to @llorllale/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@llorllale
Copy link
Contributor

@amihaiemil can this be taken out of scope?

@amihaiemil
Copy link
Owner Author

@0crat out

@0crat
Copy link
Collaborator

0crat commented Jun 22, 2018

Order was finished: +30 point(s) just awarded to @llorllale/z

@0crat
Copy link
Collaborator

0crat commented Jun 22, 2018

@0crat out (here)

@amihaiemil The job #127 is now out of scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.0.2 30min bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants