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
.envfile as needed, specially theitag - 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.txtas needed - modify
ezai-pip-req.txtas 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/ezaion linux andC:/Miniconda3/envs/ezaion windows<python-version>: Defalult is3.7- You can supply your own
requirements.txtfiles with--piptxtand--condatxt.
- for windows: execute
- 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
awscliif not already done:aws configure - Clone the repo :
git clone https://github.com/armando-fandango/ezai_env.git - Go to the
ezai_envfolder 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.ipynbfile
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
Metadata
Release files for ezai-env 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ezai_env-0.0.1.tar.gz | 2.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ezai_env-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / ezai_env-0.0.1.tar.gz
| Download URL | ezai_env-0.0.1.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe924cd0e0abd6d44fd2af80f0a21e2f9fb96560d7a10e2ec3c6e788108cac6d
|
|
BLAKE2b-256 checksum How to use checksums |
7c6571b59d555dfeea868009215b3f18fe3bb7f9fa58359ace9efd80615f0f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / ezai_env-0.0.1-py3-none-any.whl
| Download URL | ezai_env-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ed46ddf0822c010def1a685e40d68afccf39909126ccb5c515349d327642092
|
|
BLAKE2b-256 checksum How to use checksums |
645edb17437d3c54ce5c5654f34c33c9911cc38f27a232b74cae046c0ced0b7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for ezai-env 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.