-
Notifications
You must be signed in to change notification settings - Fork 124
Create recommendation-for-testing.md #444
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
Open
pvinis
wants to merge
2
commits into
main
Choose a base branch
from
pvinis-patch-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Setting up Machine Learning jobs for testing | ||
|
|
||
| Start with a folder or repo that has all the code *plus* a Dockerfile to help with running on AWS. Look at this [Dockerfile](https://github.com/artsy/entropy/blob/main/entropy/homefeed-artwork-reco/Dockerfile) for inspiration. | ||
|
|
||
| ## Setting up AWS ECR | ||
| - In the [ECR dashboard](https://console.aws.amazon.com/ecr/repositories), you can create a new *private* repository by clicking the "Create repository" button on the top right. | ||
| - Use a descriptive name | ||
|
|
||
| After it's created, click the "View push commands" button on the top right to see the commands needed to run locally to upload a built docker image to ECR. | ||
| The steps are basically: | ||
| - get a login password | ||
| - build the docker image | ||
| - tag the docker image | ||
| - push the docker image | ||
|
|
||
| After all that, you should have an image with the `latest` image tag in the newly created ECR repository. Click on it and make a note of the "Image URI", we will need it later. | ||
|
|
||
| For more documentation, look [here](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-create.html). | ||
|
|
||
| ## Setting up AWS Batch | ||
| - Open the AWS Batch console first-run wizard at https://console.aws.amazon.com/batch/home#/wizard | ||
| - Set up the environment in step 1 | ||
| - Use Fargate for provisioning model | ||
|
shaq31415926 marked this conversation as resolved.
Outdated
|
||
| - Set maximum vCPUs if needed | ||
| - Make sure you select the right networking VPC ID (use production) | ||
| - Set up the job queue in step 2 | ||
| - Priorty 1 is the default, change it if needed | ||
| - Set up the job definition in step 3 | ||
| - Set the image name in the container properties to be the `latest` Image URI from the ECR step above | ||
| - Set the command (usually `python main.py`) | ||
| - Set vCpus to maximum | ||
| - Set memory to maximum | ||
| - Execution role should be `artsy-data-infrastructure-iam-core-task-exc-production` | ||
| - Set "Assign public IP" to Enable (optional) | ||
| - Just above Parameters, click on "Additional configuration" to set the envvars under "Environment variables configuration". (`DB_REDSHIFT_NAME`, etc) | ||
| - Set up the first job in step 4 | ||
| - Set the command, vCpus and Memory to whatever you used in the previous step | ||
| - Review in step 5 and you're done! | ||
|
|
||
| For more documentation, look [here](https://docs.aws.amazon.com/batch/latest/userguide/Batch_GetStarted.html). | ||
|
|
||
| ## Setting up AWS EventBridge | ||
| In the [EventBridge dashboard](https://console.aws.amazon.com/events/home?region=us-east-1#/rules) you can create a new rule that will schedule job for you | ||
| - Click the "Create rule" button on the top right | ||
| - You can use the "Schedule" pattern, with either cron or a fixed rate | ||
| - Set the target to "Batch job queue" | ||
| - Fill in the form with the ARNs | ||
| - Find "Job queue" in Batch. Click on "Job queues" and then click on your new job queue, and find the ARN. | ||
| - Find "Job definition" in Batch. Click on "Job definitions" and then click on your new job definition, and find the ARN. | ||
| - Enter a job name, that will be the name that each new job gets. | ||
| - Create a new role for this specific resource | ||
|
|
||
| After all this, you should be able to see new jobs being created in the [ECR dashboard](https://console.aws.amazon.com/batch/home?region=us-east-1#dashboard)! Congrats. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.