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

Docker overhaul #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Docker overhaul #1

wants to merge 4 commits into from

Conversation

heavelock
Copy link

Installs all dependencies for the obspy & cartopy in the image itself

@heavelock
Copy link
Author

@barsch Could you take a look?

@barsch
Copy link
Member

barsch commented Feb 17, 2021

sorry absolutely no time this week - will try to work on it early next week

@barsch barsch self-assigned this Feb 17, 2021
@barsch
Copy link
Member

barsch commented Feb 22, 2021

@heavelock hmm I'm no docker guru - I guess I need a bit help - also see comments below:

barsch@test:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
barsch@test:~$ docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
barsch@test:~$ docker build https://github.com/heavelock/sphinx-action.git
Sending build context to Docker daemon  199.7kB
Step 1/5 : FROM sphinxdoc/sphinx:2.4.4
2.4.4: Pulling from sphinxdoc/sphinx
68ced04f60ab: Pull complete
d1d516f83cca: Pull complete
1c69061f55c9: Pull complete
cb02ba23f0ac: Pull complete
b1ed9df08170: Pull complete
24d789e44356: Pull complete
7142468f7572: Pull complete
76935118a55e: Pull complete
60e4a3211b21: Pull complete
Digest: sha256:64a91f76bd196e7d4d860f17ebfd0140c22e00c8d7cd1316812184b974d0499f
Status: Downloaded newer image for sphinxdoc/sphinx:2.4.4
 ---> 05d7cae90862
Step 2/5 : LABEL "maintainer"="Ammar Askar <[email protected]>"
 ---> Running in 415e5df5b2ef
Removing intermediate container 415e5df5b2ef
 ---> efdf7312f51e
Step 3/5 : ADD entrypoint.py /entrypoint.py
 ---> d1f90f60bb20
Step 4/5 : ADD sphinx_action /sphinx_action
 ---> 65e1a6c3d4fc
Step 5/5 : ENTRYPOINT ["/entrypoint.py"]
 ---> Running in 81f5c196fce5
Removing intermediate container 81f5c196fce5
 ---> 40ba015b6628
Successfully built 40ba015b6628
barsch@test:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
barsch@test:~$ docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              40ba015b6628        9 seconds ago       462MB
<none>              <none>              efdf7312f51e        9 seconds ago       462MB
<none>              <none>              d1f90f60bb20        9 seconds ago       462MB
<none>              <none>              65e1a6c3d4fc        9 seconds ago       462MB
sphinxdoc/sphinx    2.4.4               05d7cae90862        11 months ago       462MB
barsch@test:~$

uff a lot of images - also don't like that those are named <none>

now how to proceed?

barsch@test:~$ docker run --name obspy 40ba015b6628
[sphinx-action] Starting sphinx-action build.
====================================
Building docs in None
====================================
Traceback (most recent call last):
  File "/entrypoint.py", line 22, in <module>
    action.build_all_docs(github_env, [os.environ.get("INPUT_DOCS-FOLDER")])
  File "/sphinx_action/action.py", line 152, in build_all_docs
    return_code, annotations = build_docs(github_env.build_command, docs_dir)
  File "/sphinx_action/action.py", line 100, in build_docs
    raise ValueError("Build command may not be empty")
ValueError: Build command may not be empty
barsch@test:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
b17d8b524601        40ba015b6628        "/entrypoint.py"    5 seconds ago       Exited (1) 4 seconds ago                       obspy
barsch@test:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
b17d8b524601        40ba015b6628        "/entrypoint.py"    2 minutes ago       Exited (1) 9 seconds ago                       obspy
barsch@test:~$ docker rm b17d8b524601
b17d8b524601
barsch@test:~$ docker run --name obspy 40ba015b6628 html
[sphinx-action] Starting sphinx-action build.
====================================
Building docs in None
====================================
Traceback (most recent call last):
  File "/entrypoint.py", line 22, in <module>
    action.build_all_docs(github_env, [os.environ.get("INPUT_DOCS-FOLDER")])
  File "/sphinx_action/action.py", line 152, in build_all_docs
    return_code, annotations = build_docs(github_env.build_command, docs_dir)
  File "/sphinx_action/action.py", line 100, in build_docs
    raise ValueError("Build command may not be empty")
ValueError: Build command may not be empty
barsch@test:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS                     PORTS               NAMES
6fabbd13f235        40ba015b6628        "/entrypoint.py html"   3 seconds ago       Exited (1) 3 seconds ago                       obspy

@heavelock
Copy link
Author

Now, looking at this PR from the perspective of how you wanted to use it, I see that I will have to redo it.

To explain how it works now:
This image has entrypoint that is base of the sphinx-action Github Action. The action itself is interpreting the events sent by github and parsing output from sphinx and then it just adds it to a visible place in the workflow's interface.

Image itself in this is not easily usable because it requires a few environment variables that are passed from the GH Action system.

So my plan for now:

  1. Create a separate image for building docs that everybody will just be able to build and use on their own.
  2. Add it to the main obspy repo (or maybe a separate project? how do you think?) and make GH Action workflow to build it and push it to https://hub.docker.com/u/obspy.
  3. This repo will be using that image as a base and will just add the entrypoint and all the stuff that the sphinx-action itself requires to run.

What do you think?

@barsch
Copy link
Member

barsch commented Feb 22, 2021

yes, I am definitely in favor of a standalone Docker image - usable as shown above - if we can reuse this image than for github action than it would be perfect. Adding this to the main repo is IMHO also the best solution - currently the doc builder scripts are already part of it (https://github.com/obspy/obspy/tree/master/misc/docs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants