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 for build dependencies only - WIP #718

Closed
wants to merge 20 commits into from

Conversation

jamessynge
Copy link
Contributor

Incomplete, but almost there.

Extract docker specific portion of README.md into ci/README.md.

More changes to come, but this is setting the stage.
Haven't yet removed the temporary copy of POCS.
This is the standard convention.
@jamessynge jamessynge requested a review from wtgee November 1, 2018 11:16
@codecov
Copy link

codecov bot commented Nov 1, 2018

Codecov Report

Merging #718 into develop will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #718      +/-   ##
===========================================
- Coverage     80.2%   80.18%   -0.02%     
===========================================
  Files           61       61              
  Lines         5096     5096              
  Branches       697      697              
===========================================
- Hits          4087     4086       -1     
  Misses         816      816              
- Partials       193      194       +1
Impacted Files Coverage Δ
pocs/observatory.py 89.52% <0%> (-0.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f89011...7bf470b. Read the comment docs.

@jamessynge
Copy link
Contributor Author

Please take a look and let me know what you think... or try it out yourself.
I plan to remove the $POCS/* contents from the image, to add useful readme content, and maybe to add a script to automate the build process (i.e. inserting the appropriate strings into the Dockerfile and piping that the docker build).

Copy link
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to be used only for travis? I had some comments about having multi-stage builds and the use of RUN. If this is to be only used for travis those might not as apply as much.

This kind of seems like a WIP? I can't quite tell what the scope of this PR should be or how it relates to #712 and #713.

  • README cleanups, including the removal of duplicates

#
# Setup directories needed by PANOPTES. Other scripts, such as
# install-dependencies.sh, expect to find these directories.
# We do NOT parameterize these paths (i.e. don't use environment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just allow this from $PANDIR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question. Could you clarify?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just seems to hardcode the directory so I was wondering the reason.

# these, the cached image layer is used).

# Update the information we know about package versions.
RUN apt-get update --fix-missing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that in general you want to minimize the number of RUN, COPY, and ADD steps as they each create new layers and thus inflate the size. I realize we might be caching them but it still causes the overall container size to be larger.

Unless this is being used as part of a multi-stage build? But if that is the case it seems like we should stage it up even more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not worry about that until we have a generally working process. You're right that it does increase the number of cached intermediates, but it turns out that is really valuable when working on changing the later steps in the Dockerfile.


# First we copy the files and directories least likely to change while
# iterating on the building of the Docker image.
COPY .codecov.yml .coveragerc .gitignore .gitmodules .pycodestyle.cfg \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the selective copying? Is this also for caching purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It avoids copying .git, build, htmlcov, etc. I put in the full list of files and directories in the repo simply to avoid getting ridiculous about selectivity... and so that it can be automated. I want to be able to run scripts/download_support_files.sh, which means I'll probably need to run setup.py, but I probably don't really want the full impact of that cached (i.e. a modified miniconda tree), so some thought will be needed.

(set -x ; ${CHOWN} -R "${PANUSER}:${PANUSER}" /var/panoptes)
(set -x ; ${CHMOD} -R 755 /var/panoptes)

for SUBDIR in POCS PAWS logs astrometry/data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These directories all seem a) hard-coded b) buried in the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the directories that currently checked by some of our install or download scripts. I'd appreciate suggestions regarding improving this, as I don't have one at the moment.

@@ -0,0 +1,47 @@
#!/bin/bash -ex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this file related to #712 and #713?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A copy from one of those, esp. since I think this may be a more fruitful direction. I like that I can iterate locally on Dockerfile, unlike working with the travis file.

scripts/install/install-astrometry.sh Outdated Show resolved Hide resolved
scripts/install/install-astrometry.sh Show resolved Hide resolved
scripts/install/install-astrometry.sh Show resolved Hide resolved
return



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need everything below if the script is already installing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, rushed to get the dockerfile to you, but this part is clearly a WIP. In particular, IFF we are going to move in the direction of docker, then we don't need to have a single file that one can download in order to do an install, so we could break this huge file up into various scripts with a single coordinator. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFF we are going to move in the direction of docker

I still don't understand if this question regarding docker is for testing (on travis) or if it applies more generally to an install method. Or even more sorta-generally as an image that could be used, e.g. for compute instance images, travis, etc.

Breaking it up would favor either approach as you could have different files (or I think there are build "flavors" or something) for different targets but build them from the same intermediary stages.

wtgee and others added 5 commits November 2, 2018 16:21
Split apt-packages-list.txt into two files, one for
use in ci, the other with the remaining packages.

This is still a WIP.
@jamessynge jamessynge changed the title Docker for build dependencies only. Docker for build dependencies only - WIP Nov 2, 2018
@jamessynge
Copy link
Contributor Author

I'm going to close this, and will send other smaller PRs when ready.

@jamessynge jamessynge closed this Nov 6, 2018
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