Just like a traditional notebook, Mage supports execution in native cloud environments. Below are guides on how to integrate with native cloud resources.
python3
installed. All Python versions between
3.7.0 (inclusive) and 3.10.0 (exclusive) are supported.
When launching an EC2 instance, we suggest using the following AMI:
AMI ID | AMI name |
---|---|
ami-0d70546e43a941d70 | ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20220609 |
ec2_username
is typically ubuntu
if you used the AMI we
recommended above.
An example SSH command could look like this:
scripts/run_ec2.sh
script to launch Mage in an EC2 instance.
Currently only connections via SSH are supported. To access this script
clone this repository.
To run Mage in an EC2 instance, you need to provide
ec2_username
is typically ubuntu
if you used the AMI we
recommended above.
You can optionally add --name custom_repo_name
to the end of the command above
to name your project something different than the default of default_repo
.
An example command could look like this:
--name
to specify your own custom repository name)<ec2-instance-public-ip>:6789
to access the
Mage app, where ec2-instance-public-ip
is the Public IPv4 address of your
EC2 instance.
pip
. It is
recommended to use a virtual environment to store the Python packages to
isolate your Python dependencies per project.
mage init
. You can change your
repository name as per your preference.
-N
option tells your SSH client to not send user commands to the EC2
server through this connection since this connection is only for port
forwarding"image"
- Docker image URI. If using ECR, you can use the template above
and fill in the following information:
Parameter | Description |
---|---|
aws-account-id | AWS Account ID |
region | Region in which ECR is being used |
your-image-repo-name | Name of the repository holding your repo |
tag | tag for the version of the image to use |
"executionRoleArn"
- Name of the
ECS Task Execution Role.
Assigning this role enables this task to make AWS API calls. This is needed
to pull the Docker image from an ECR repository. Fill in the following
information:
Parameter | Description |
---|---|
aws-account-id | AWS Account ID |
ecs-task-execution-role-name | Name of task execution IAM role |
your-public-ip:6789
. If you followed the previous steps correctly, you
should be able to access the Mage app running in your cluster.
mage run
on your pipeline when started.
"image"
- Docker image URI. If using ECR, you can use the template above
and fill in the following information:
Parameter | Description |
---|---|
aws-account-id | AWS Account ID |
region | Region in which ECR is being used |
your-image-repo-name | Name of the repository holding your repo |
tag | tag for the version of the image to use |
"executionRoleArn"
- Name of the
ECS Task Execution Role.
Assigning this role enables this task to make AWS API calls. This is needed
to pull the Docker image from an ECR repository. Fill in the following
information:
Parameter | Description |
---|---|
aws-account-id | AWS Account ID |
ecs-task-execution-role-name | Name of task execution IAM role |
your-pipeline-name
- name of the pipeline to run. This pipeline must be
stored in the repository you added to your Docker image.