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

As a user, I can specify a single monorepo Habushu module and Habushu will stage the source code required to build that module in my build directory, so I can containerize my python services #150

Closed
6 tasks done
Cho-William opened this issue Jun 14, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Cho-William
Copy link
Contributor

Cho-William commented Jun 14, 2024

Description

This ticket is the first of a series to implement a more resilient and consistent pattern for installing Python monorepo dependencies to Docker containers. The scope of this ticket will cover augmenting Habushu's existing functionality to utilize the Maven session to stage Python module source code files to the docker build context (without needing to specify any relative-paths for monorepo Python dependencies), and leveraging these changes with the aiSSEMBLE baseline's relevant docker images.

DOD

  • Update the relevant docker module poms in the aiSSEMBLE baseline:
    • Remove the Orphedomos retrieve-wheels execution
    • Add the new Habushu execution of containerize-dependencies
  • Update the relevant docker module Dockerfiles in the aiSSEMBLE baseline:
    • Modify build to work with the Habushu-injected logic
  • Ensure the modified docker modules in the baseline can build successfully and run

Test Steps

  1. OTS Only: Build python Docker images in the baseline and ensure they build successfully
mvn clean install -am -pl :aissemble-model-training-api,:aissemble-model-training-api-sagemaker,:aissemble-versioning
  1. Run aissemble-model-training-api-sagemaker and ensure it starts successfully (i.e. uvicorn starts up):
docker run --rm -it ghcr.io/boozallen/aissemble-model-training-api-sagemaker:1.8.0-SNAPSHOT
  1. Create a new project:
mvn archetype:generate -DarchetypeGroupId=com.boozallen.aissemble \
                       -DarchetypeArtifactId=foundation-archetype \
                       -DarchetypeVersion=1.8.0-SNAPSHOT \
                       -DgroupId=org.test \
                       -DartifactId=test-150 \
                       -DprojectGitUrl=test.org/test-150.git \
                       -DprojectName="Test Issue 150" \
&& cd test-150
  1. Add TrainingPipeline.json to test-150-pipeline-models/src/main/resources/pipelines
  2. Run mvn clean install and resolve manual actions
  3. Repeat until no more actions are printed
  4. Deploy the project and wait for everything to start: tilt up
  5. Verify that the versioning service started up and is listening on port 80
  6. Submit the training job to the model-training-api:
curl -X POST -H "Content-Type: application/json" 'localhost:5001/training-jobs?pipeline_step=ExampleTrainingStep' -d '{}'
  1. Retrieve the submitted jobs for the training step and verify the new job appears:
curl 'localhost:5001/training-jobs?pipeline_step=ExampleTrainingStep' | sed 's/\\n/\n/g'
  1. Retrieve the logs for the submitted job and verify the job completed successfully:
curl localhost:5001/training-jobs/<JOB NAME FROM PREVIOUS STEPS> | sed 's/\\n/\n/g'
@Cho-William Cho-William added the enhancement New feature or request label Jun 14, 2024
@Cho-William Cho-William self-assigned this Jun 14, 2024
@Cho-William Cho-William added this to the 1.8.0 milestone Jun 14, 2024
@Cho-William Cho-William changed the title Feature: As an aiSSEMBLE developer, I want a flexible process for installing python dependencies to my docker containers, so that I can consistently leverage dependencies As a user, I can specify a single monorepo Habushu module and Habushu will stage the source code required to build that module in my build directory, so I can containerize my python services Jun 14, 2024
@ewilkins-csi
Copy link
Contributor

OTS completed with @Cho-William

ewilkins-csi added a commit that referenced this issue Jul 8, 2024
#150 use Habushu's `containerize-dependencies` goal
ewilkins-csi added a commit that referenced this issue Jul 9, 2024
#150 revert fastapi image to `python:3.11` and re-use default docker cache
ewilkins-csi added a commit that referenced this issue Jul 9, 2024
@Cho-William
Copy link
Contributor Author

Final test passed!
Screenshot 2024-07-10 at 9 06 46 AM
Screenshot 2024-07-10 at 9 05 12 AM
Screenshot 2024-07-10 at 8 54 08 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants