Skip to content

Instantly share code, notes, and snippets.

View sofianhamiti's full-sized avatar

Sofian Hamiti sofianhamiti

View GitHub Profile
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VPCDeployment",
"Effect": "Deny",
"Action": [
"sagemaker:CreateAutoMLJob",
"sagemaker:CreateDataQualityJobDefinition",
"sagemaker:CreateDomain",
from sagemaker.workflow.retry import (
StepRetryPolicy,
StepExceptionTypeEnum,
SageMakerJobStepRetryPolicy,
SageMakerJobExceptionTypeEnum
)
step_retry_policy = StepRetryPolicy(
exception_types=[
StepExceptionTypeEnum.SERVICE_FAULT,
step_train = TrainingStep(
name="TrainAbaloneModel",
estimator=xgb_train,
inputs={...},
retry_policies=[
step_retry_policy,
job_retry_policy
]
)
"""Example workflow pipeline script for abalone pipeline.
. -RegisterModel
.
Process-> Train -> Evaluate -> Condition .
.
. -(stop)
Implements a get_pipeline(**kwargs) method.
"""
import json
import boto3
import logging
from botocore.config import Config
logger = logging.getLogger()
logger.setLevel(logging.INFO)
config = Config(retries = {'max_attempts': 10,'mode': 'standard'})
#!/usr/bin/env bash
# install code-server with Anaconda
conda install -y -c conda-forge code-server
# run code-server with no auth is for illustrative purposes.
# Make sure you enable authentication in your environment https://coder.com/docs/code-server/latest
code-server --auth none
#!/bin/bash
mkdir -p vscode
cd vscode
sudo su
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.9.1
exit
#!/bin/bash
# REPLACE HOST WITH YOUR NOTEBOOK INSTANCE URL BEFORE RUNNING THE COMMAND
docker run \
-it \
-p 8080:8080 \
-v /home/ec2-user/SageMaker/mydata:/label-studio/data \
heartexlabs/label-studio:latest label-studio \
--host https://your-notebook-instance-name.notebook.your-region.sagemaker.aws/proxy/8080
#!/bin/bash
# /home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/pip install -U keytar jupyter-server-proxy
echo == INSTALLING CODE-SERVER ==
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=4.12.0
#########################################
### INTEGRATE CODE-SERVER WITH JUPYTER
#########################################
echo == UPDATING THE JUPYTER SERVER CONFIG ==
#!/bin/bash
set -e
#################################################
## INSTALL DEPENDENCIES AND PULL CONTAINER IMAGE
#################################################
echo ==INSTALLING DEPENDENCIES==
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/pip install -U jupyter-server-proxy
/usr/bin/docker pull heartexlabs/label-studio:latest