Giter VIP home page Giter VIP logo

miniconda2's Introduction

Miniconda is a platform independent python environment that is easily configured with python and pip support without the need of root user.

A use case maybe you do not have root access or takes a very long time to get certain devops/cloud/automation tooling to be available for you and you need to get to work 'fast'.

From miniconda website: https://conda.io/docs/user-guide/install/index.html

NOTE: You do not need administrative or root permissions to install Anaconda if you select a user-writable install location.

I chose to use miniconda and not virtualenv (which requires to be on the server to begin with and installed with root user privileges and after using it extensively it's very clunky and very selective on environment variables/$PATH) miniconda does not require such permissions.

For further reading check out this https://news.ycombinator.com/item?id=11374804

Time to get you up and running about 7 minutes.

The following is for my needs and works on CentOS 7.4 (64bit) OS

Get into my home directory and create directory

cd ~
pwd
mkdir -p miniconda && cd miniconda

Download and install into my directory

MINICONDA_VERSION=latest
wget https://repo.continuum.io/miniconda/Miniconda2-${MINICONDA_VERSION}-Linux-x86_64.sh \
&& chmod 755 Miniconda2-${MINICONDA_VERSION}-Linux-x86_64.sh \
&& ./Miniconda2-${MINICONDA_VERSION}-Linux-x86_64.sh -b -p ~/miniconda2

Download default condarc and autoswitching (when entering a directory)

wget https://raw.githubusercontent.com/jimsmith/miniconda/master/.condarc -O ~/.condarc \
&& wget https://raw.githubusercontent.com/jimsmith/miniconda/master/conda_auto_env.sh -O ~/conda_auto_env.sh \
&& chmod 755 ~/conda_auto_env.sh

Update my bashrc

cat <<EOF >>~/.bashrc
#
# 01/03/2018 - added Minicoda2 path
export PATH=~/miniconda2/bin:$PATH
#
# 01/03/2018 - added conda autoswitching
source ~/conda_auto_env.sh
EOF

Activate without logging out

source ~/.bashrc

Update conda to latest version

which conda
conda update conda

Setup autoswitching

mkdir -p ~/miniconda/awscli/ \
&& cd ~/miniconda/awscli/ \
&& wget https://raw.githubusercontent.com/jimsmith/miniconda/master/environment.yml

If you experience message of -bash: PROMPT_COMMAND: readonly variable then check that this is not been set elsewhere for example in /etc/bashrc

Now create my miniconda environment with Python 2.7 for the python interpreter

conda create --yes --quiet --name awscli python=2.7 pip
  

Tip: to activate the environment manually:

source activate awscli

(awscli) [jim@centos7 miniconda]$ pwd
/home/jim/miniconda/awscli

Next install the programs I need from latest-requirements.txt

(awscli) [jim@centos7 miniconda]$ pip install -r https://raw.githubusercontent.com/jimsmith/miniconda/master/latest-requirements.txt

Bonus points confirming they are installed.

(awscli) [jim@centos7 miniconda]$ ansible --version
(awscli) [jim@centos7 miniconda]$ aws --version

Update my bashrc

cat <<EOF >>~/.bashrc
#
# 01/03/2018 - added aws autocomplete
complete -C '~/miniconda2/envs/awscli/bin/aws_completer' aws
#
EOF

Next go and configure Ansible's EC2 Dynamic Inventory

https://github.com/jimsmith/miniconda/blob/master/CONFIGURE_ANSIBLE_EC2.md

miniconda2's People

Contributors

jimsmith avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

miniconda2's Issues

sed options did not work on the OS X

hello Jim

Thank you for putting together this - i am testing this out if we can use it in our env. I had an issue while running this part of the command, the sed -i option did not work on OSX

sed -i 's/all_instances = False/all_instances = True/g' ec2.ini
sed -i 's/destination_variable = public_dns_name/destination_variable = private_dns_name/g' ec2.ini
sed -i 's/vpc_destination_variable = ip_address/vpc_destination_variable = private_ip_address/g' ec2.ini
sed -i 's/route53 = False/route53 = True/g' ec2.ini
sed -i 's/all_rds_instances = False/all_rds_instances = True/g' ec2.ini
sed -i 's/include_rds_clusters = False/include_rds_clusters = True/g' ec2.ini
sed -i 's/all_elasticache_replication_groups = False/all_elasticache_replication_groups = True/g' ec2.ini
sed -i 's/all_elasticache_clusters = False/all_elasticache_clusters = True/g' ec2.ini
sed -i 's/all_elasticache_nodes = False/all_elasticache_nodes = True/g' ec2.ini

and this is what I had to do to make it work for me

sed -i=''  's/all_instances = False/all_instances = True/g' ec2.ini
sed -i='' 's/destination_variable = public_dns_name/destination_variable = private_dns_name/g' ec2.ini
sed -i='' 's/vpc_destination_variable = ip_address/vpc_destination_variable = private_ip_address/g' ec2.ini
sed -i='' 's/route53 = False/route53 = True/g' ec2.ini
sed -i='' 's/all_rds_instances = False/all_rds_instances = True/g' ec2.ini
sed -i='' 's/include_rds_clusters = False/include_rds_clusters = True/g' ec2.ini
sed -i='' 's/all_elasticache_replication_groups = False/all_elasticache_replication_groups = True/g' ec2.ini
sed -i='' 's/all_elasticache_clusters = False/all_elasticache_clusters = True/g' ec2.ini
sed -i='' 's/all_elasticache_nodes = False/all_elasticache_nodes = True/g' ec2.ini

cheers

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.