Coder Social home page Coder Social logo

Comments (6)

ltalirz avatar ltalirz commented on June 13, 2024

All one apparently needs to do is to pass the --init flag to docker run.

In our case, the container is started by the dockerspawner, and I guess the configuration option will be something like

c.DockerSpawner.extra_run_kwargs = {
    'init': '',
}

and needs to be added here:
https://github.com/materialscloud-org/openstack-ansible/blob/738b83e2f8295e944f24f2e62079c41fc88aa04d/roles/mc_jupyter/templates/jupyterhub_config.py#L19-L25

See https://github.com/jupyterhub/dockerspawner/blob/19e26f3d1f5fd196b2a750f9e9c525bcfa0c95fb/dockerspawner/dockerspawner.py#L480-L487
and
jupyterhub/jupyterhub#1599

from aiidalab-docker-stack.

ltalirz avatar ltalirz commented on June 13, 2024

Done in 69ccdb5
Still need to check whether this actually works... (@oschuett how do we know?)

from aiidalab-docker-stack.

oschuett avatar oschuett commented on June 13, 2024

I believe the main purpose of tini was to clean up child processes. So, I would just check if any processes remain after a container was forcefully shutdown.

from aiidalab-docker-stack.

ltalirz avatar ltalirz commented on June 13, 2024

Thanks, Ole!

Note to self: The extra_run_kwargs didn't do the trick yet...

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
    1 scienti+  20   0   19948   3588   3260 S   0.0  0.0   0:00.03 start-sing+

process with PID 1 should beinit (as verified by running the docker image with --init locally)

from aiidalab-docker-stack.

ltalirz avatar ltalirz commented on June 13, 2024

it's extra_start_kwargs, but even this doesn't work because docker-py does no longer support it...

No solution so far: jupyterhub/dockerspawner#192

from aiidalab-docker-stack.

ltalirz avatar ltalirz commented on June 13, 2024

Turns out the solution is

c.DockerSpawner.extra_host_config.update({ 'init': True })
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
    1 scienti+  20   0    1144      4      0 S   0.0  0.0   0:00.04 init

from aiidalab-docker-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.