-
Notifications
You must be signed in to change notification settings - Fork 4
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
Create a module for building yagna Docker images #325
Conversation
goth/runner/container/build.py
Outdated
class YagnaBuildEnvironment: | ||
"""Configuration for the Docker build process of a yagna image.""" | ||
|
||
archive_path: Optional[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.
@zakaprov are all of these properties independent? ... my common sense tells me you'd only ever need just one of them? ...
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 agree: archive_path
and binary_dir
could me made a single property.
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.
Sure, I can merge those into a single parameter which will handle all three cases (i.e. directory, single binary and archive).
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.
Updated in 8fc8f8d
|
||
|
||
@dataclass(frozen=True) | ||
class YagnaBuildEnvironment: |
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.
given that all the functions in this file use "environment" as an argument - wouldn't it rather make sense for them all to be methods of the YagnaBuildEnvironment
class?
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.
IMHO in this case it's mainly a matter of style and personal preferences. I like it this (i.e. non-OO) way. Plus, it makes it more clear that YagnaBuildEnvironment is immutable (for what it's worth).
goth/runner/container/build.py
Outdated
context_deb_dir.mkdir() | ||
|
||
if env.binary_dir: | ||
logger.info("using local yagna binaries. path=%s", env.binary_dir) |
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.
We don't have any convention for this, but just for the record: I prefer log messages starting with a capital letter.
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.
Now that you mentioned this I noticed that most of the INFO
logs that we have start with capitals. Fine with me, I'll update these.
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.
Updated in 39f256a
Co-authored-by: azawlocki <[email protected]>
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.
Left some comments, mostly nitpicking except perhaps for the suggestion to replace several properties of YagnaBuildEnvironment
with a single property.
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.
LGTM!
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.
looks good as far as I can tell :)
Resolves: #317
Summary of changes:
goth/runner/container/build.py
which handles building the Docker image for yagnadocker build
goth/runner/container/compose.py#start_network
docker/yagna-goth.Dockerfile
anddocker/docker-compose.yml
have been updated to reflect the updated build processgoth
subtree underrunner/download
scripts
directory under the project rootdirs_exist_ok
parameter onshutil.copytree
)_run_command
function fromrunner/container/compose.py
has been extracted to a separate module underrunner/process.py