Skip to content

Anaconda Installation – CentOS Cloud VM

-==Disclaimer==-

This is just a custom guide to a INSTANCE on Google Cloud Platform, this could be more technical and advanced guide, if you do not understand or don’t know what you are doing, I kindly request you to take extreme caution. The components used here are billable. SKYDEVOPS/I/WE do not take any responsibility if the guide causes any serious damage or issues, which you have to take full responsibility.

Assuming that you have access to any cloud provider or any cloud instance like AWS, GCP, Rackspace, DigitalOcean, Linode etc. The instance used has the following specification.  This is the Guide to install and configure Anaconda Distribution for Data Science Projects. This guide is a part of Devops for Data Science

-==System Requirements==-

  • CPU: 64-bit 2.8 GHz
  • RAM: 4 GB (min)
  • Storage: 30 GB.
  • License: Free use & redistribution under the terms of Anaconda End User License.
  • OS: Windows 7,8,10, macOS 10.10+, or, Ubuntu, RedHat, CentOS 6+, and others.
  • System architecture: 64-bit x86, 32-bit x86 with Windows or Linux

-==GUIDE==-

  • Part-01: Creating a Instance on the Google Cloud Platform
  • Part-02: Installing and configuring Anaconda Distribution – Traditional
  • Part-03: Updating and Upgrading Anaconda Distribution
  • Part-04: Installing and configuring Anaconda in Docker Container
  • Part-05: Minimising the size of the Anaconda Docker Image
  • Part-06: Pushing the image to Docker Hub
  • Part-07: Automating the entire process using GitHub, Docker Hub

-== Part-01: Creating a Instance on the Google Cloud Platform ==-

Step-01: Name the Instance and select the Region and Zone

Screen Shot 2018-06-14 at 5.57.46 PM.png

Step-02: Select the Machine Type

Screen Shot 2018-06-14 at 5.57.57 PM.png

Step-03: Select the Boot Disk and Storage Options

Screen Shot 2018-06-14 at 5.58.17 PM

Step-04: Select OS

Screen Shot 2018-06-14 at 5.58.29 PM

Step-05: Verify the Instance

Screen Shot 2018-06-14 at 6.00.20 PM

Step-06: Add the DNS configuration

Screen Shot 2018-06-14 at 6.01.12 PM

Step-07: Login to the Server

Screen Shot 2018-06-14 at 6.34.57 PM

Step-08: Install pre-requisites and update cache

Screen Shot 2018-06-14 at 6.36.12 PM

Step-09: Verify the OS release

Screen Shot 2018-06-14 at 6.38.27 PM

Step-10: Done – Setting up the instance is completed

-==&&==-

 -== Part-02: Installing & configuring Anaconda – Traditional ==- 

Step-01: Download the Anaconda Python distribution

Screen Shot 2018-06-14 at 6.42.27 PM

Step-02: Python 2.7.x will be used in this guide

Screen Shot 2018-06-14 at 6.46.53 PM

Step-03: Create the directory structure for installation

Screen Shot 2018-06-14 at 6.52.24 PM

Step-04: Install Anaconda Distribution

Screen Shot 2018-06-14 at 6.49.25 PM

Step-05: Accept the License

Screen Shot 2018-06-14 at 6.53.39 PM

Step-06: Select the Installation Path

Screen Shot 2018-06-14 at 6.54.48 PM

Step-07: Add to the PATH variable

Screen Shot 2018-06-14 at 8.23.16 PM

Step-08: Do not install VS Code

Screen Shot 2018-06-14 at 8.23.23 PM.png

Step-09: Verify Anaconda installation

Screen Shot 2018-06-14 at 8.54.07 PM.png

–==&&==-

 -== Part-03: Updating and Upgrading Anaconda Distribution ==-

Step-01: Updating Conda

Screen Shot 2018-06-14 at 9.00.03 PM.png

Step-02: Update Anaconda

Screen Shot 2018-06-14 at 9.11.17 PM.png

Step-03: Update All Packages

Screen Shot 2018-06-14 at 9.13.12 PM
Screen Shot 2018-06-14 at 9.14.47 PM

Step-04: Testing Jupyter Notebooks

Screen Shot 2018-06-14 at 9.26.15 PM

-==&&==-

-== Part-04: Installing and configuring Anaconda in Docker Container ==-

Step-01: Installing Docker pre-requisites

Screen Shot 2018-06-14 at 9.30.53 PM

Step-02: Add the Docker CE Repo

Screen Shot 2018-06-14 at 9.32.24 PM

Step-03: Install Docker Community Edition

Screen Shot 2018-06-14 at 9.33.34 PM.png

Step-04: Starting and Enabling Docker

$ sudo systemctl start docker
$ sudo systemctl enable docker

Step-05: Verifying docker installation

Screen Shot 2018-06-14 at 9.35.42 PM
Screen Shot 2018-06-14 at 9.42.30 PM.png

Step-06: Dockerfile


# Pre-Built Skydevops CentOS image
FROM skydevops/skydevops-centos7-ansible
LABEL maintainer="syebbare@skydevops.in"

# Updating Centos packages and installing Anaconda
RUN yum update && yes|yum upgrade && \
yum install -y wget bzip2 && \
wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh && \
bash Anaconda2-5.2.0-Linux-x86_64.sh -b && \
rm Anaconda2-5.2.0-Linux-x86_64.sh

# Set path to conda
ENV PATH /root/anaconda2/bin:$PATH

# Configuring access to Jupyter
RUN mkdir /opt/notebooks \
jupyter notebook --generate-config --allow-root \
echo "c.NotebookApp.password = u'sha1:277aa1c52ca6:3a6f71c6f36fc191f238c07e5ca08878837e14f3'" >> /root/.jupyter/jupyter_notebook_config.py

# Jupyter listens port: 8888
EXPOSE 8888
# Run Jupyter notebook as Docker main process
CMD ["jupyter", "notebook", "--allow-root", "--notebook-dir=/opt/notebooks", "--ip='*'", "--port=8888", "--no-browser"]

Step-07: Create an image using the Dockerfile


$ docker build -t ds-skydevops .

Step-08: Building Image

Screen Shot 2018-06-14 at 11.08.25 PM

Step-09: Installing Anaconda

Screen Shot 2018-06-14 at 11.09.01 PM

Step-10: Creating Firewall Rule on GCP

Screen Shot 2018-06-14 at 11.23.47 PM.png

Step-11: Firewall Details

Screen Shot 2018-06-14 at 11.25.04 PM.png

Step-12: Assigning it to instance

Screen Shot 2018-06-14 at 11.25.55 PM
Screen Shot 2018-06-14 at 11.26.06 PM

Shashi View All

-== Superman ==-

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: