# Slinky test on AWS
## Setup eksctl and awscli
### Create access keys
1. Click account ID shown on top right corner of AWS page after login, then click "Security credentials" in the drop-down menu;
2. In the "My security credentials page", click "Create access key" button;
3. When filling the forms for the key creation, choose "Command Line interface" for the "use case";
4. Put in a description of the key, and save the key ID and value after creation.
### Install and configure aws cli
1. Follow the instructions [here](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) for the installation;
2. Configure the aws cli with the access key ID and value created above. Instrucitons can be found [here](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html) or [here](https://docs.aws.amazon.com/eks/latest/userguide/install-awscli.html) or [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-authentication-user.html#cli-authentication-user-get).
### Setup and configure `kubectl` and `eksctl`
Instructions can be found [here](https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html). Installation of `eksctl` can be found [here](https://eksctl.io/installation/). It uses `~/.aws/credentials` file or [environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) for authentication.
## Install slinky
SchedMD's guide can be found [here](https://slinky.schedmd.com/docs/slurm-operator/0.2.x/quickstart-guides/amazon_eks/).
One thing to note that the commands on the page assumes the default AWS region is set to "us-west-2". If your default region is set to a different one when configuring `aws cli`, you may need to either:
1. change the default region by modifying the value in `~/.aws/config` or via `aws configure`;
2. explicitly set aws region when calling some of the `aws` commands listed in the guide.
Another thing to note is related the `helm install` commands in the page. The charts have been moved to OCI charts.
A more up-to-date instruction can be found [here](https://hackmd.io/bFPrfYdkRTmYw1abKR8lIQ) in the GitHub repo.
The commands used are:
```bash=
curl -L https://raw.githubusercontent.com/SlinkyProject/slurm-operator/refs/heads/main/helm/slurm-operator/values.yaml -o values-operator.yaml
helm install slurm-operator oci://ghcr.io/slinkyproject/charts/slurm-operator --namespace=slinky --create-namespace -f values-operator.yaml
curl -L https://raw.githubusercontent.com/SlinkyProject/slurm-operator/refs/heads/main/helm/slurm/values.yaml -o values-slurm.yaml
helm install slurm oci://ghcr.io/slinkyproject/charts/slurm --namespace=slurm --create-namespace -f values-slurm.yaml
```
## Giving others access to the EKS cluster
Instructions can be found [here](https://repost.aws/knowledge-center/amazon-eks-cluster-access). I haven't done this step yet.
## Scale down the cluster
1. To go EC2 dashboard in AWS webUI;
2. Click on "Auto Scaling Groups";
3. Set "Desired capacity", "Scaling limits (min-max)" all to 0.
Alternatively, this can be done via `eksctl` with:
```bash=
eksctl get cluster # to get cluster name
eksctl get nodegroup --cluster CLUSTERNAME # to get node group name
eksctl scale nodegroup --cluster CLUSTERNAME --name NODEGROUPNAME --nodes 0 --nodes-max 1 --nodes-min 0
```