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

Add docker image #81

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

Conversation

lilianabs
Copy link

To be able to merge a pull request, there are a few checks:

DO NOT DELETE THE BELOW TEXT FROM THE BODY OF THE PULL REQUEST. ADD YOUR DESCRIPTION(S) FROM THE POINT IT SAYS "Goal or purpose of the PR". USE THIS TEMPLATE AS IS.


USE THE CHECKLIST TO SHOW PROGRESS AND A REMINDER FOR YOURSELF.

Checklist

Please check the options that you have completed and strike-out the options that do not apply via this pull request:

  • a clear title and description to the Pull Request has been provided
  • you have read
  • the pull request passes the tests (./test-coverage.sh "tests slow-tests") - this will also be visible via the Code coverage report and CI/CD task on the Pull Request
  • you have performed some kind of smoke test by running your changes in an isolated environment i.e. Docker container, Google Colab, Kaggle, etc...
  • the notebooks are updated (see notebooks folder, read the Notebooks docs)
  • CHANGELOG.md has been updated (please follow the existing format)

Goal or purpose of the PR

This PR adds a docker image for the package development.

@neomatrix369 neomatrix369 self-requested a review June 26, 2023 21:09
@neomatrix369 neomatrix369 added this to Doing in NLP Profiler via automation Jun 26, 2023
@neomatrix369
Copy link
Owner

@lilianabs looks neat, nice work! I will test it out and share my comments here.

@neomatrix369
Copy link
Owner

Could you pls post a screen shot of the docker container running and giving you a prompt as per the code - does not have to be exact or working, just want to see what it looks like on your end.

It's easy to take a screenshot and drag it into the comment box and it turns it into a image url to link to

Copy link
Owner

@neomatrix369 neomatrix369 left a comment

Choose a reason for hiding this comment

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

Well done, good work!

Overall looks good, pending some good testing on my part.
Also shared comments and suggestions on existing code.

I will do another pass and share some more comments, in the meanwhile please try to implement/improve what you can - based on the comments shared.

@@ -0,0 +1,17 @@
FROM python:3.7
Copy link
Owner

Choose a reason for hiding this comment

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

See if you can make this python version configurable that you can pass it via the shell script or environment variable.

If you look into the docker shell scripts in any of these examples here, you can see how it's done.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for pointing this out. I've updated the Dockerfile to pass the argument via the shell script.

@@ -0,0 +1,17 @@
FROM python:3.7

Copy link
Owner

Choose a reason for hiding this comment

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

Try to get familiar with hadolint and apply it to your Dockerfile to see what suggestions it gives you in terms of improving the code, here's a post to learn more about it

Copy link
Author

Choose a reason for hiding this comment

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

I've used hadolint to format the Dockerfile accordingly :)


RUN apt-get install -y git

RUN git clone https://github.com/neomatrix369/nlp_profiler.git
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of doing this try to see if you can actually use the local folder and the code downloaded in it - there is an advantage and purpose for doing it.

See how it has been done here.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the suggestion Mani. I've updated the file so it uses the local folder.

echo "Mounted volume: ${MOUNT_VOLUME}"

docker build -t ${DOCKER_IMAGE_NAME} .

Copy link
Owner

Choose a reason for hiding this comment

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

It's a good practice to show this line executing with all its parameters, how would you do that in bash?

Also look at one of the examples from the resources shared above

@@ -0,0 +1,20 @@
#!/bin/bash
Copy link
Owner

Choose a reason for hiding this comment

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

Try to get familiar with a bash shell linter to see what comments it has about your shell script - search for shellcheck, install it and then use it on this shell script.

Use the comments from shellcheck to improve the code if any comments are given


echo "~~~ Running nlp_profiler in a docker container"
echo "Mounted volume: ${MOUNT_VOLUME}"

Copy link
Owner

Choose a reason for hiding this comment

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

Its a good practise to echo the steps that are executed at the different lines in the code - this way when one reads the console they can tell what stage of the shellscript it is at - look at examples of my own code to find out how we have been doing it, the clue is look for echos in the shell script and also in the Dockerfile

@lilianabs
Copy link
Author

Could you pls post a screen shot of the docker container running and giving you a prompt as per the code - does not have to be exact or working, just want to see what it looks like on your end.

It's easy to take a screenshot and drag it into the comment box and it turns it into a image url to link to

Thank you for reviewing the PR Mani! Here is a screenshot:

Screenshot 2023-06-26 at 20 01 48

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

Successfully merging this pull request may close these issues.

None yet

2 participants