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

Generate a Docker container within the CI build #142

Closed

Conversation

algattik
Copy link
Contributor

Resolves #141

Changes:

  • Generate a Docker container within the CI build, tagged with a checksum of the Dockerfile and requirements.txt files so it can be reused across run. Store this Docker container in the AML ACR. Use this Docker container for running unit tests.
    image

  • Other jobs still use the mcr.microsoft.com/mlops/python:latest image as before. This allows derived projects to install "large" ML frameworks in the CI build, without making subsequent jobs needlessly slow to start.

  • Allow developers to lint & test locally in a single command: streamlined use of flake8 and pytest within tox.

$ tox
python run-test-pre: PYTHONHASHSEED='1159078597'
python run-test: commands[0] | flake8 --output-file=lint-testresults.xml --format junit-xml
python run-test: commands[1] | pytest tests/unit --cov=code --cov-report=xml --junitxml=unit-testresults.xml
=========================================================================== test session starts ===========================================================================
...
tests/unit/code_test.py .                                                                                                                                           [ 20%]
tests/unit/data_test.py .
...                                                                                                                                        
---------- coverage: platform darwin, python 3.7.6-final-0 -----------
Coverage HTML written to dir htmlcov
Coverage XML written to file /Users/algattik/GitHub/MLOpsPython2/coverage.xml

====================================================================== 5 passed, 4 warnings in 6.34s ======================================================================
_________________________________________________________________________________ summary _________________________________________________________________________________
  python: commands succeeded
  congratulations :)
  • Added code coverage report. Required adapted pytest commandline (now in tox.ini) and installing .NET Core as for security reasons, the AzDO PublishCodeCoverageResults does not publish user-generated HTML reports anymore.
    image

  • Linting fixes in some .py scripts to avoid CI build failing.

  • Some simplifications in the build pipeline YAML.

Notes to MLOpsPython repo maintainers:

  • The pipeline building the mcr.microsoft.com/mlops/python:latest image was moved from environment_setup/toenvironment_setup/mlops-image`. The intention was to make it clear to users that there are two separate Docker images. The production AzDO pipeline that maintains the mcr.microsoft.com/mlops/python:latest image will have to be updated.
  • The mcr.microsoft.com/mlops/python:latest image was updated to include only the modules needed for running the ml_service scripts, i.e. removing numpy, pandas and scikit-learn. This may break existing users and should be evaluated, we can also put those modules back. Perhaps the best solution is to abandon mcr.microsoft.com/mlops/python:latest and just build that image in the project's ACR, like the CI build image?
  • Suggesting to adopt a fixed tagging scheme for the mcr.microsoft.com/mlops/python repo for reproducibility. Also ideally fixing the AML SDK version.

@eedorenko eedorenko self-assigned this Jan 22, 2020
Copy link
Contributor

@eedorenko eedorenko left a comment

Choose a reason for hiding this comment

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

Requested changes

@algattik
Copy link
Contributor Author

Superseded by #150

@algattik algattik closed this Jan 24, 2020
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.

Limitations of using shared mcr.microsoft.com/mlops/python:latest container
2 participants