-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from mlrun/development
dev to main: update docs and github action
- Loading branch information
Showing
9 changed files
with
134 additions
and
38 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- closed | ||
branches: | ||
- staging | ||
- master | ||
- main | ||
|
||
jobs: | ||
deploy-workflow: | ||
|
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 |
---|---|---|
@@ -1 +1,45 @@ | ||
# demo-sagemaker | ||
# AWS SageMaker Demo with MLRun | ||
|
||
This demo showcases how to build, manage, and deploy machine learning models using AWS SageMaker and MLRun. It emphasizes the automation of ML workflows from development to production. | ||
|
||
This demo is based on the SageMaker Payment Classification use case from the SageMaker's example repository (https://github.com/aws/amazon-sagemaker-examples/blob/main/use-cases/financial_payment_classification/financial_payment_classification.ipynb). | ||
|
||
## Key Components | ||
|
||
- **AWS SageMaker**: A comprehensive service that enables developers and data scientists to build, train, and deploy machine learning (ML) models efficiently. | ||
|
||
- **MLRun**: An open-source MLOps framework designed to manage and automate your machine learning and data science lifecycle. In this demo, it is used to automate ML deployment and workflows. | ||
|
||
## Running the Demo | ||
|
||
1. **Prerequisites**: Ensure you have an AWS account with SageMaker enabled and MLRun installed in your environment. | ||
|
||
2. **Clone the repository**: Clone this repository to your SageMaker notebook environment. | ||
|
||
3. **Set the environment variables in `mlrun.env`**: Copy the `mlrun.env` file to your workspace and fill in the necessary environment variables such as `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, `SAGEMAKER_ROLE`, `MLRUN_DBPATH`, `V3IO_USERNAME`, and `V3IO_ACCESS_KEY`. | ||
|
||
4. **Run the Jupyter notebook**: Open and run the `financial-payment-pipeline.ipynb` notebook. This notebook contains the code for the financial payment classification pipeline. | ||
|
||
5. **Monitor your runs**: Track your runs in the MLRun dashboard. The dashboard provides a graphical interface for tracking your MLRun projects, functions, runs, and artifacts. | ||
|
||
You can also open `financial-payment-classification.ipynb` to review the SageMaker code and the MLRun code segments cell-by-cell. This notebook does not include the automated workflow, but rather the individual steps. | ||
|
||
## CI/CD using GitHub Actions | ||
This demo also includes a workflow for automating the execution of the machine learning pipeline. To set this up: | ||
|
||
1. **Fork this repository**: Create a copy of this repository in your own GitHub account by forking it. | ||
|
||
2. **Add Secrets to Your Repository**: Navigate to the "Settings" tab in your GitHub repository, then click on "Secrets". Here, you need to add the following secrets, which will be used as environment variables in your workflow: | ||
|
||
- `AWS_ACCESS_KEY_ID` | ||
- `AWS_SECRET_ACCESS_KEY` | ||
- `AWS_DEFAULT_REGION` | ||
- `SAGEMAKER_ROLE` | ||
- `MLRUN_DBPATH` | ||
- `V3IO_ACCESS_KEY` | ||
|
||
Additionally, set the `V3IO_USERNAME` environment variable to your username. | ||
|
||
3. **Commit and Push Your Changes**: Make any necessary changes to the code, then commit and push these changes to your repository. | ||
|
||
4. **Create a Pull Request**: Create a pull request to either the `staging` or `main` branch. Once the pull request is merged, it will trigger the GitHub action. You can review the pipeline execution in the MLRun UI, a link to which can be found in the workflow steps. |
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 |
---|---|---|
@@ -1,8 +1,23 @@ | ||
# This file contains environment variables for configuring the SageMaker and MLRun environments. | ||
|
||
|
||
# AWS_ACCESS_KEY_ID: This is the access key for your AWS account. It is used to authenticate and authorize AWS API requests. | ||
AWS_ACCESS_KEY_ID= | ||
|
||
# AWS_SECRET_ACCESS_KEY: This is the secret key for your AWS account. It is used along with the access key to sign programmatic AWS API requests. | ||
AWS_SECRET_ACCESS_KEY= | ||
|
||
# AWS_DEFAULT_REGION: This is the default region that AWS CLI and SDKs will interact with when no other region is specified. | ||
AWS_DEFAULT_REGION= | ||
|
||
# SAGEMAKER_ROLE: This is the AWS IAM role that Amazon SageMaker can assume to perform tasks on your behalf (e.g., reading training results, writing model artifacts). | ||
SAGEMAKER_ROLE= | ||
|
||
# MLRUN_DBPATH: This is the path to the database that MLRun uses to store metadata for MLRun projects, functions, runs, and artifacts. | ||
MLRUN_DBPATH= | ||
|
||
# V3IO_USERNAME: This is the username for the V3IO data platform, which is a high-performance data storage and processing platform. | ||
V3IO_USERNAME= | ||
V3IO_ACCESS_KEY= | ||
|
||
# V3IO_ACCESS_KEY: This is the access key for the V3IO data platform. It is used to authenticate requests to the V3IO API. | ||
V3IO_ACCESS_KEY= |
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
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
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