-
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
Add docstrings and minor style fixes for application files and JuliaBuildPack #213
Conversation
e2948bb
to
cd78015
Compare
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 awesome, @willingc! Left some comments with suggested changes, but everything looks pretty accurate to me.
repo2docker/app.py
Outdated
name = 'jupyter-repo2docker' | ||
version = __version__ | ||
description = __doc__ | ||
|
||
@default('log_level') | ||
def _default_log_level(self): | ||
"""The system's default log level""" |
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.
The application's default log level?
repo2docker/app.py
Outdated
Validate image_name read by argparse contains only lowercase characters | ||
Validate image_name read by argparse | ||
|
||
Note: image_name contains only lowercase characters |
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.
Ah, I think you've found a bug in our docs :) This is not the actual validation logic we use nor the actual liimts, but I see our exception in 194 says this too.
The logic we use + the valid criteria is 'Container names must start with an alphanumeric character and can then use _ . or - in addition to alphanumeric. [a-zA-Z0-9][a-zA-Z0-9_.-]+'. We can either update that in this PR or do that in a separate one! Good catch!
repo2docker/app.py
Outdated
@@ -444,6 +463,7 @@ def push_image(self): | |||
last_emit_time = time.time() | |||
|
|||
def run_image(self): | |||
"""Run docker image""" |
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.
"Run docker container from built image" perhaps?
""" | ||
def get_env(self): | ||
"""Get additional environment settings for Julia and Jupyter | ||
|
||
Returns: |
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.
I think the docstrings here should explain what exactly is being returned, since the generic docstring for what get_env is returning is already in the base BuildPack. I think explaining each of the env variable set here and why we do it would be the useful thing here.
- JULIA_PATH - base path where all Julia Binaries and libraries will be installed
- JULIA_HOME - path where all Julia Binaries will be installed
- JULIA_PKGDIR - path where all Julia libraries will be installed
- JULIA_VERSION - default version of julia to be installed
- JUPYTER - environment variable required by IJulia to point to
jupyter
executable
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.
added 👍
repo2docker/buildpacks/julia.py
Outdated
@@ -22,9 +31,30 @@ def get_env(self): | |||
] | |||
|
|||
def get_path(self): | |||
"""Get path for Julia executables | |||
|
|||
Returns: |
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.
Adds path to Julia binaries to user's PATH.
Also we can simplify this code to just be:
return super().get_path() + ['${JULIA_HOME}']
but also ok to not do that!
repo2docker/buildpacks/julia.py
Outdated
|
||
This sets up: | ||
|
||
- a directory for the specified Julia version and path |
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.
It installs Julia itself, and also installs IJulia (Pkg.add
sounds like you are adding to something, but it really is installing the package)
""" | ||
Return series of build-steps specific to "this" Julia repository | ||
|
||
Precompile all Julia libraries found in the repository's REQUIRE |
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.
+1!
repo2docker/buildpacks/julia.py
Outdated
""" | ||
Check if current repo should be built with the Julia Build pack | ||
|
||
super().detect() is called if Julia Build pack should be used. |
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.
I think similar to the R build pack, we should actually not call super().detect() here, for the same reason as on the R build pack (we want to use Julia even if there is no environment.yml file). Whenever I'm doing doc fixes I'm also happy to fix bugs so documenting them is easier, but happy to deal with that in a separate PR too!
repo2docker/utils.py
Outdated
@@ -53,55 +54,65 @@ def flush(): | |||
|
|||
@contextmanager | |||
def maybe_cleanup(path, cleanup=False): | |||
"""Execute cleanup of the passed path when cleanup flag is True.""" |
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.
"Delete the directory at passed path if cleanup flag is True"
109512c
to
d627200
Compare
repo2docker/buildpacks/julia.py
Outdated
This installs: | ||
|
||
- the specified Julia version and path | ||
- Julia packages with ownership granted to the notebook user |
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.
It only creates a directory with permissions for installing julia packages (from get_assemble_scripts), does not actually install them here
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.
Thanks. I will update. Still working on the corrections from yesterday.
9623fc0
to
fc3e370
Compare
@yuvipanda I think that I've covered all your review comments. |
Great! |
Thanks @minrk for the merge. Going to try to finish all the docstrings today. |
Add docstrings and minor style fixes for application files and JuliaBuildPack
Partially addresses #211
Covers repo2docker application files:
app.py
utils.py
__main__.py
And
JuliaBuildPack