GithubHelp home page GithubHelp logo

tobytyl / sagemaker-practice-on-aws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from debdattasarkar/sagemaker-practice-on-aws

0.0 0.0 0.0 4.41 MB

SageMaker Practice on AWS

License: MIT License

Jupyter Notebook 100.00%

sagemaker-practice-on-aws's Introduction

SageMaker Hands-On on AWS

ViewCount GitHub top language GitHub language count Stars Badge Forks Badge Pull Requests Badge Total Downloads

💻 Practical Appilcation of Real Life Scenarios on AWS SageMaker Studio / Notebook Instances

Name Source
Employee Salary Prediction - Using AWS SageMaker Linear Learner Udemy
Medical Insurance Premium Prediction - Linear Learner - Artificial Neural Network Udemy
Retail Sales Prediction - Using AWS SageMaker XGBoost (Regression) Udemy

🤺 AWS Sagemaker CLI Commands

1. Retrieve the list of domains in your account.
aws --region Region sagemaker list-domains

Example

aws --region us-east-2 sagemaker list-domains

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker list-domains
{
    "Domains": [
        {
            "DomainArn": "arn:aws:sagemaker:us-east-2:807100423897:domain/d-mxkxcy82frnd",
            "DomainId": "d-mxkxcy82frnd",
            "DomainName": "default-1634999453430",
            "Status": "InService",
            "CreationTime": "2021-10-23T14:30:55.857000+00:00",
            "LastModifiedTime": "2021-10-23T14:35:41.514000+00:00",
            "Url": "https://d-mxkxcy82frnd.studio.us-east-2.sagemaker.aws"
        }
    ]
}
2. Retrieve the list of applications for the domain to be deleted.
aws --region Region sagemaker list-apps \
    --domain-id-equals DomainId

Example

aws --region us-east-2 sagemaker list-apps \
        --domain-id-equals d-mxkxcy82frnd

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker list-apps \
>         --domain-id-equals d-mxkxcy82frnd
{
    "Apps": [
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "KernelGateway",
            "AppName": "datascience-1-0-ml-t3-medium-b3043d3e6163713f99726df4a911",
            "Status": "InService",
            "CreationTime": "2021-10-23T14:40:45.328000+00:00"
        },
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "JupyterServer",
            "AppName": "default",
            "Status": "InService",
            "CreationTime": "2021-10-23T14:36:16.825000+00:00"
        }
    ]
}
3. Delete each application in the list.
aws --region Region sagemaker delete-app \
    --domain-id DomainId \
    --app-name AppName \
    --app-type AppType \
    --user-profile-name UserProfileName

Example

aws --region us-east-2 sagemaker delete-app \
    --domain-id d-mxkxcy82frnd \
    --app-name default \
    --app-type JupyterServer \
    --user-profile-name debdattasagemaker

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker delete-app \
>     --domain-id d-mxkxcy82frnd \
>     --app-name default \
>     --app-type JupyterServer \
>     --user-profile-name debdattasagemaker

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker list-apps \
>         --domain-id-equals d-mxkxcy82frnd
{
    "Apps": [
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "KernelGateway",
            "AppName": "datascience-1-0-ml-t3-medium-b3043d3e6163713f99726df4a911",
            "Status": "InService",
            "CreationTime": "2021-10-23T14:40:45.328000+00:00"
        },
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "JupyterServer",
            "AppName": "default",
            "Status": "Deleted",
            "CreationTime": "2021-10-23T14:36:16.825000+00:00"
        }
    ]
}
aws --region us-east-2 sagemaker delete-app \
    --domain-id d-mxkxcy82frnd \
    --app-name datascience-1-0-ml-t3-medium-b3043d3e6163713f99726df4a911 \
    --app-type KernelGateway \
    --user-profile-name debdattasagemaker

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker list-apps         --domain-id-equals d-mxkxcy82frnd{
    "Apps": [
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "KernelGateway",
            "AppName": "datascience-1-0-ml-t3-medium-b3043d3e6163713f99726df4a911",
            "Status": "Deleted",
            "CreationTime": "2021-10-23T14:40:45.328000+00:00"
        },
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "AppType": "JupyterServer",
            "AppName": "default",
            "Status": "Deleted",
            "CreationTime": "2021-10-23T14:36:16.825000+00:00"
        }
    ]
}
4. Retrieve the list of user profiles in the domain.
aws --region Region sagemaker list-user-profiles \
    --domain-id-equals DomainId

Example

aws --region us-east-2 sagemaker list-user-profiles \
    --domain-id-equals d-mxkxcy82frnd

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker list-user-profiles \
>     --domain-id-equals d-mxkxcy82frnd
{
    "UserProfiles": [
        {
            "DomainId": "d-mxkxcy82frnd",
            "UserProfileName": "debdattasagemaker",
            "Status": "InService",
            "CreationTime": "2021-10-23T14:35:46.247000+00:00",
            "LastModifiedTime": "2021-10-23T14:35:50.802000+00:00"
        }
    ]
}
5. Delete each user profile in the list.
aws --region Region sagemaker delete-user-profile \
    --domain-id DomainId \
    --user-profile-name UserProfileName

Example

aws --region us-east-2 sagemaker delete-user-profile \
    --domain-id d-mxkxcy82frnd \
    --user-profile-name 

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker delete-user-profile \
>    --domain-id d-mxkxcy82frnd \
>    --user-profile-name debdattasagemaker
6. Delete the domain. To also delete the Amazon EFS volume, specify HomeEfsFileSystem=Delete.
aws --region Region sagemaker delete-domain \
    --domain-id DomainId \
    --retention-policy HomeEfsFileSystem=Retain

Example

aws --region us-east-2 sagemaker delete-domain \
    --domain-id d-mxkxcy82frnd \
    --retention-policy HomeEfsFileSystem=Delete

Output

[cloudshell-user@ip-10-0-137-51 ~]$ aws --region us-east-2 sagemaker delete-domain \
>     --domain-id d-mxkxcy82frnd \
>     --retention-policy HomeEfsFileSystem=Delete

⛏️ Skills Applied

Python Pandas NumPy scikit-learn AWS Jupyter TensorFlow Keras

© Copyright 2021 - Debdatta Sarkar

LinkedIn Profile

sagemaker-practice-on-aws's People

Contributors

debdattasarkar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.