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

Can we connect to a running job ? #33

Open
thibaultduponchelle opened this issue Jan 4, 2021 · 4 comments
Open

Can we connect to a running job ? #33

thibaultduponchelle opened this issue Jan 4, 2021 · 4 comments
Labels
feature request question Further information is requested

Comments

@thibaultduponchelle
Copy link
Contributor

I know we can, at least with docker (something like docker -H tcp://thenodewhereitisexecuted exec -ti thelayerhash /bin/bash) but do we have the info somewhere (in the logs or better in the running build ("report") page ?

Extra bonus : It could go with a "pause" feature for short living jobs (I'm greedy sorry)

@melezhik melezhik added feature request question Further information is requested labels Jan 4, 2021
@melezhik
Copy link
Owner

melezhik commented Jan 4, 2021

So you want to be able to attach to a running docker container that executes a Sparky job? I might be wrong, but in that case, you'll need an ssh access to a host that runs a Sparky ...

@thibaultduponchelle
Copy link
Contributor Author

thibaultduponchelle commented Jan 8, 2021

You don't need ssh access

Here is a detailed example.

Change the docker systemd service to add a tcp socket :

/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock

Reload systemd + restart

Write a Dockerfile:

FROM alpine

COPY w.sh w.sh

CMD ["./w.sh"]

And a while/sleep loop w.sh to maintain it alive:

#!/bin/sh

while true; do sleep 2 ; echo "foreground"; done

Build image:

docker build . -t persist

Start container

docker run -itd persist

And on a remote machine:

docker -H tcp://the-url-or-ip exec -ti 25686e95ce26e9c4d8e2e38ea5d9cfe3332a61820a31fd9007b039b41c3bb358 /bin/sh

It means that for this issue, we need a correct dockerd setup + a line in the build report page "you can connect to the docker container like this" (or in the logs).

@melezhik
Copy link
Owner

melezhik commented Jan 8, 2021

so, you want to make a docker daemon available from public, right?

@thibaultduponchelle
Copy link
Contributor Author

thibaultduponchelle commented Jan 9, 2021

No, this feature is for sysadmin running the whole thing.

I wanted simply to report in sparky ui something like « you can connect inside your docker container with: docker -H tcp:// etc... »

(Plus eventually a « pause » feature)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants