Skip to content

Set up your local data service location#

The quickest way to get started with Ametnes Cloud is to set up your local workstation as an Ametnes Data Service Location.

In this article, you will learn how easy it is to deploy data services on your local workstation. We will create a JupyterHub service on your local workstation and connect to it locally.

Brief summary#

Here is a summary of the steps you will need to follow. Firstly, install the prerequisite software if not present then we create a kubernetes cluster and set it up as an Ametnes Data Service location and then finally, we create a simple data application.

Signup#

If you do not have an Ametnes Cloud account, sign up here to create one.

Setting up an Ametnes Data Services Location#

An Ametnes Data Service Location is basically a kubernetes cluster that is set up and connected to the Ametnes Cloud control plane. It will generally be a dedicated cluster but that is not mandatory.

Install Prerequisites.#

Depending on your operating system, the prerequisites to get you started will differ.

Setup the chocolatey package manager. For this you need to start PowerShell with elevated permissions as an Administrator. Once this is done, run the following command.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Install docker desktop with

choco install docker-desktop -y
You will need to restart your computer with to complete the setup of docker.

Install docker using Homebrew with

brew install --cask docker

After the installation is done, launch docker and enter your password when prompted to give docker priviledge access.

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" -y
sudo apt install docker-ce -y
sudo usermod -aG docker $USER
sg docker -c "bash"
sudo systemctl status docker

Install helm package manager

Install helm with chocolatey

choco install kubernetes-helm

Restart your machine

Install helm using Homebrew with

brew install helm

Download and install helm

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

Enable kubernetes in Docker Desktop#

  1. From the Docker Dashboard, select the Settings icon.

    Docker Desktop Dashboard Mac

  2. Select Kubernetes from the left sidebar menu.

  3. Next to Enable Kubernetes, select the checkbox.

    Docker Desktop Dashboard Kubernetes

  4. Select Apply & Restart to save the settings and then select Install to confirm.

  5. This instantiates images required to run the Kubernetes server as containers, and installs the /usr/local/bin/kubectl

Install the Ametnes Cloud Agent#

  1. Add the helm repository.

    helm repo add ametnes https://ametnes.github.io/helm && helm repo update
    
  2. Generate a UUID on your command line. This is how your local computer will be identified at the Ametnes Cloud control plane.

    uuidgen
    

    If you are on Windows, the command may not work. You can alternatively generate the uuid online from here

  3. Install the Ametnes Cloud Agent and set the agent.config.location to the UUID generated above.

    helm upgrade --install --create-namespace --namespace ametnes-system ametnes-cloud-agent ametnes/cloud-agent --set agent.config.location=<the generated uuid>
    
  4. In your Ametnes Cloud console account, create a Data Service Location with

    1. Login into your Ametnes Cloud account here.
    2. Nagivate to the Service Locations menu on the left
    3. Click New Location
    4. Enter the following
      1. User Supplied Id: the generated-uuid
      2. Name: Demo
      3. Code: DSL1
      4. Click Create
  5. After a short while, the data service location should come online.

Create the service#

Log into your Ametnes Cloud console at here or sign up here if you do not have one.

  1. Using the Services left menu, navigate to the service management dashboard.
  2. Click New Service.
  3. Enter the Jupyter to filter from the list and select Create
  4. In the displayed form, enter the following info.
    1. Enter the Name: JupyterHub-Service-DSL1 and Description: JupyterHub-Service-DSL1.
    2. Select a Version from the list.
    3. Select the Location: Demo/DSL1.
    4. Click Create.

Test connectivity#

  1. Using the Services left menu, navigate to the service management dashboard. Your service should be listed.

    Service not showing

    If your service list is empty, use the filter at the top right corner, to filter for ALL services.

  2. After a while, your data service status will change to ready.

  3. To the right of your service, click the Admin button and you will navigate to your service's details page.
  4. At the bottom of the page, copy the endpoint of your service as well as your username/key and password.
  5. In your browser, paste the URL https://<your.instance.host.name>/.
  6. You should get a prompt to login.

Clean up#

Delete all services#

  1. In your Ametnes Cloud console, navigate to the Admin section of each service
  2. Delete the service.

Uninstall the cloud agent#

In your terminal, enter

helm delete ametnes-cloud-agent -n ametnes-system

Uninstall helm#

brew uninstall helm

Summary#

In this post, we explored how to set up your local workstation as an Ametnes Data Service location. This then allowed us to deploy a JupyterHub service that we were able to connect to.