-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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,39 @@ | ||
# Mlflow Image | ||
|
||
## Description | ||
|
||
This module creates an mlflow tracking server container image and pushes to the specified Elastic Container Repository. | ||
|
||
## Inputs/Outputs | ||
|
||
### Input Parameters | ||
|
||
#### Required | ||
|
||
- `ecr-repository-name`: The name of the ECR repository to push the image to. | ||
|
||
### Sample manifest declaration | ||
|
||
```yaml | ||
name: mlflow-image | ||
path: modules/mlflow/mlflow-image | ||
parameters: | ||
- name: ecr-repository-name | ||
valueFrom: | ||
moduleMetadata: | ||
group: storage | ||
name: ecr-mlflow | ||
key: EcrRepositoryName | ||
``` | ||
### Module Metadata Outputs | ||
- `MlflowImageUri`: Mlflow image URI | ||
|
||
#### Output Example | ||
|
||
```json | ||
{ | ||
"MlflowImageUri": "xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/ecr-mlflow:latest" | ||
} | ||
``` |
This file contains 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,21 @@ | ||
publishGenericEnvVariables: true | ||
deploy: | ||
phases: | ||
build: | ||
commands: | ||
- aws ecr describe-repositories --repository-names ${SEEDFARMER_PARAMETER_ECR_REPOSITORY_NAME} || aws ecr create-repository --repository-name ${SEEDFARMER_PARAMETER_ECR_REPOSITORY_NAME} --image-scanning-configuration scanOnPush=true | ||
- export COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) | ||
- export IMAGE_TAG=ai-gw-${COMMIT_HASH:=latest} | ||
- export REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/${SEEDFARMER_PARAMETER_ECR_REPOSITORY_NAME} | ||
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com | ||
- echo Building the Docker image... | ||
- cd src/ && docker build -t $REPOSITORY_URI:latest . | ||
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG | ||
- docker push $REPOSITORY_URI:$IMAGE_TAG | ||
- seedfarmer metadata add -k ImageUri -v $REPOSITORY_URI:latest | ||
destroy: | ||
phases: | ||
build: | ||
commands: | ||
- aws ecr delete-repository --repository-name ${SEEDFARMER_PARAMETER_ECR_REPOSITORY_NAME} --force | ||
# build_type: BUILD_GENERAL1_LARGE |
This file contains 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,42 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Description: This stack deploys a Module specific IAM permissions | ||
|
||
Parameters: | ||
# DeploymentName: | ||
# Type: String | ||
# Description: The name of the deployment | ||
# ModuleName: | ||
# Type: String | ||
# Description: The name of the Module | ||
RoleName: | ||
Type: String | ||
Description: The name of the IAM Role | ||
ECRRepositoryName: | ||
Type: String | ||
Description: The name of the ECR repository | ||
|
||
Resources: | ||
Policy: | ||
Type: "AWS::IAM::Policy" | ||
Properties: | ||
PolicyDocument: | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- "ecr:Describe*" | ||
- "ecr:Get*" | ||
- "ecr:List*" | ||
Resource: "*" | ||
- Action: | ||
- "ecr:Create*" | ||
- "ecr:Delete*" | ||
- "ecr:*LayerUpload" | ||
- "ecr:UploadLayerPart" | ||
- "ecr:Batch*" | ||
- "ecr:Put*" | ||
Effect: Allow | ||
Resource: | ||
- !Sub "arn:${AWS::Partition}:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ECRRepositoryName}" | ||
Version: 2012-10-17 | ||
PolicyName: "modulespecific-policy" | ||
Roles: [!Ref RoleName] |
This file contains 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,15 @@ | ||
FROM public.ecr.aws/docker/library/python:3.10.15 | ||
|
||
RUN pip install \ | ||
'mlflow[gateway]' \ | ||
mlflow==2.17.0 && \ | ||
mkdir /mlflow/ | ||
|
||
EXPOSE 7000 | ||
|
||
COPY config.yaml ./mlflow/config.yaml | ||
|
||
CMD mlflow gateway start \ | ||
--host 0.0.0.0 \ | ||
--port 7000 \ | ||
--config-path ./mlflow/config.yaml; |
This file contains 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,13 @@ | ||
endpoints: | ||
- name: chat | ||
endpoint_type: llm/v1/chat | ||
model: | ||
provider: bedrock | ||
name: anthropic.claude-3-5-sonnet-20240620-v1:0 | ||
config: | ||
aws_config: | ||
aws_region: 'AWS_REGION' | ||
aws_role_arn: 'AWS_ROLE_ARN' | ||
limit: | ||
renewal_period: minute | ||
calls: 10 |
This file contains 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