Skip to main content

Environment for EZAI

Project description

ezai_env

Description

Docker container and conda virtual environment creation for doing AI on local machines, Kubernetes or SageMaker.

Pre-requisites for building

  • Linux: Python is Installed
  • Windows: Python is installed, preferably miniconda.

Usage

EZAI in docker environment with conda:

Note: This version maps $home directory and /mnt directory on the host to docker container, so be careful with modifying anything in these folders inside the container, it will also be modified on the host

Do the following first:

  • Download the two files: curl -O "https://raw.githubusercontent.com/armando-fandango/ezai_env/main/{.env,ezai-docker}"
  • modify .env file as needed, specially the itag
  • execute source ezai-docker
  • now use any of the following commands

To run EZAI container

  • ezai_runc
    • pulls the image if not present
    • starts the container if not started
    • enters the container
  • I generally create an alias in bash to run the notebooks from the container quickly: alias eznb='conda activate ezai && jupyter notebook --ip=* --no-browser'

To pull EZAI image:

  • ezai_pull_image

To remove EZAI container

  • ezai_rmc

To remove EZAI image

  • ezai_rmi

To build EZAI image

  • ezai_build_image

EZAI conda environment on your local machine (no docker):

  • modify ezai-conda-req.txt as needed
  • modify ezai-pip-req.txt as needed
  • for linux: execute ezai-conda-create.sh --venv <location-of-env> --python-ver <python-version>
    • for windows: execute ezai-conda-create.ps1 -venv <location-of-env> -python-ver <python-version>
    • <location-of-env>: Default is /opt/conda/envs/ezai on linux and C:/Miniconda3/envs/ezai on windows
    • <python-version>: Defalult is 3.7
    • You can supply your own requirements.txt files with --piptxt and --condatxt.
  • activate the environment with conda activate <location-of-env>
  • test the tensorflow and pytroch GPU with pytest -p no:warnings -vv

EZAI conda environment in AWS SageMaker instance:

The SageMaker instance should be already created and stopped before following these steps.

On your laptop

  • Configure awscli if not already done: aws configure
  • Clone the repo : git clone https://github.com/armando-fandango/ezai_env.git
  • Go to the ezai_env folder where you cloned the repo
  • source the file source ezai-conda
  • Set the SageMaker env: set_sagemaker_env -i <instance_name>

Prepare the SageMaker instance

  • Launch the instance and open a terminal
  • In the terminal: cd /home/ec2-user/SageMaker/ezai_env
  • Create conda environment: ./ezai-conda-create.sh --venv /home/ec2-user/SageMaker/envs/ezai
  • activate the environment with conda activate /home/ec2-user/SageMaker/envs/ezai
  • test the tensorflow and pytorch GPU with pytest -p no:warnings -vv

Test it

  • Open the test.ipynb file

TODO:

  • Give option to create fully isolated container
  • Give option to select which libraries to install
  • add/enable more libraries
  • make separate dockerfile for Sumo and create only if asked from the run

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezai_env-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezai_env-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file ezai_env-0.0.1.tar.gz.

File metadata

  • Download URL: ezai_env-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for ezai_env-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fe924cd0e0abd6d44fd2af80f0a21e2f9fb96560d7a10e2ec3c6e788108cac6d
MD5 5ffa5f621fe274a3e0b51963d1823e79
BLAKE2b-256 7c6571b59d555dfeea868009215b3f18fe3bb7f9fa58359ace9efd80615f0f92

See more details on using hashes here.

File details

Details for the file ezai_env-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ezai_env-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.8

File hashes

Hashes for ezai_env-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed46ddf0822c010def1a685e40d68afccf39909126ccb5c515349d327642092
MD5 d806f585c3d95fd1bbd3341ce917ec15
BLAKE2b-256 645edb17437d3c54ce5c5654f34c33c9911cc38f27a232b74cae046c0ced0b7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page