-
Notifications
You must be signed in to change notification settings - Fork 362
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
[MRG] Define an interface for Container engines #848
Conversation
@@ -11,15 +11,15 @@ | |||
import sys | |||
import logging | |||
import os | |||
import entrypoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new dependency, but it's already used in other Jupyter projects such as jupyterhub for managing entrypoints:
https://github.com/jupyterhub/jupyterhub/blob/bc7bb5076ff2deabc7702c75dce208166d14568e/requirements.txt#L4
.pre-commit-config.yaml
Outdated
@@ -3,3 +3,5 @@ repos: | |||
rev: 18.9b0 | |||
hooks: | |||
- id: black | |||
# Doesn't work: | |||
# args: [--target-version py35] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-commit/black formats the files as Python 3.6 but this is incompatible with Python 3.5 and the above config doesn't work.
See the # fmt: off
comments in repo2docker/docker.py
for the alternative workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully #849 will fix this
tag : str | ||
Tag to add to the image | ||
|
||
custom_context : bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom_context
and fileobj
and very biased towards the Docker API. However it's fairly easy in Python to untar this tarfile-like-object into a temporary directory so it can be made to work.
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/brainstorming-repo2docker-action-vm-on-gcp-aws-azure/5345/16 |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: |
@manics I'm happy to merge this now if you can do a rebase - so we can catch any test failures that might happen right after we merge. I tried doing it locally and ran into a couple conflicts... |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/building-a-the-littlest-binderhub/9824/1 |
@yuvipanda Rebased! Just the CircleCI test that's still failing (#1050) |
@manics awesome. That's fine I think. |
@manics exciting change!!!! Thank you for working on it and pushing it through. I think once the podman backend and repo2docker have a a release, what do you think of a blog post? |
I'm happy to contribute to a blog post! I need to figure out a more reliable way to install podman as the tests have broken again: manics/repo2podman#2 |
Summary
Closes #682
repo2docker/engine.py
). Engines areLoggingConfigurable
- in future this could allow advanced configuration though the repo2docker config file. This is the file that needs the most review since it defines the specification for others.repo2docker/docker.py
)This is based on my attempt at a podman backend in #806
In general most of the Docker Client methods could be easily implemented in a Podman wrapper.
Details
The main exceptions are
build()
andpush_image()
:{"stream": line}
which is enough to convince repo2docker:string_output
to indicate whether they follow the Docker API in returning objects or if they return plain strings.Remaining todos:
repo2docker.engine
entrypointOther engines
I've switched to using an entrypoint for
ContainerEngine
implementations. The defaultdocker
engine remains in this project. I've moved #806 (WIP: Podman backend
) into a new project: https://github.com/manics/repo2docker-podman. Instructions are included in that project's README.