Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress on hackathon automation and content #59

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 33 additions & 23 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -81,48 +81,58 @@ Once the cluster gpu machinepool has been created we need to deploy [[https://mi
#+NAME: Install minio via oc
#+begin_src tmux
# Deploy minio
oc new-project minio && oc --namespace minio apply -f setup/minio-setup.yaml
oc new-project minio && oc --namespace minio apply --filename setup/minio-setup.yaml

# Wait for minio to come up
oc --namespace minio rollout status deployment/minio --watch
#+end_src


With minio deployed we need to create a bucket and upload some content to it.
With minio deployed we need to create a bucket and upload some content to it to pre seed a model. We can do this by remotely executing minio cli `mc` commands within the `minio` pod.

#+NAME: Configure minio via oc
#+begin_src tmux
oc get pods -n minio
#+end_src
# Retrieve the running minio pod
pod=$(oc get pods --namespace "minio" --output name)

# Retrieve the minio credentials
minio_user=$(oc --namespace "minio" get secret "minio-secret" -o jsonpath='{.data.minio_root_user}' | base64 --decode)
minio_pass=$(oc --namespace "minio" get secret "minio-secret" -o jsonpath='{.data.minio_root_password}' | base64 --decode)

** Download model from huggingface into each `on prem` clusters Minio `model`'s bucket
# Configure the minio cli alias
oc --namespace "minio" exec "${pod}" -- mc alias set local http://localhost:9000 "${minio_user}" "${minio_pass}"

#+begin_src tmux
HUGGINGFACE_TOKEN="HUGGINGFACE_TOKEN"
pip install --upgrade huggingface_hub
huggingface-cli login --token "${HUGGINGFACE_TOKEN}"
git clone https://huggingface.co/instructlab/granite-7b-lab
# Make the models bucket
oc --namespace "minio" exec "${pod}" -- mc mb "local/models"
#+end_src

or use this:
https://github.com/tnscorcoran/rhods-finetunning-demo/blob/main/vllm_get_from_huggingface.ipynb

** Populate minio bucket with model

** Upload model to cluster minio
Consider using this:
https://github.com/tnscorcoran/rhods-finetunning-demo/blob/main/vllm_push_to_minio.ipynb
With the bucket created we need to push some model content to it, we can do that with the magic of `git` and `mc`. We need to start by downloading the bucket content.

TODO Run aws configure and pull values out of that automatically.

#+begin_src tmux
export AWS_ACCESS_KEY_ID=<placeholder>
export AWS_SECRET_ACCESS_KEY=<placeholder>
export AWS_DEFAULT_REGION=<placeholder>
export AWS_S3_ENDPOINT=$(oc get route minio-api -o jsonpath='.spec.host')
export AWS_S3_BUCKET="models"

python3 setup/minio-upload.py
pod=$(oc get pods --namespace "minio" --output name)
oc --namespace "minio" exec "${pod}" -- mkdir /tmp/model --parent
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/added_tokens.json?download=true -o /tmp/model/added_tokens.json
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/config.json?download=true -o /tmp/model/config.json
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/generation_config.json?download=true -o /tmp/model/generation_config.json
oc --namespace minio exec "${pod}" -- curl -L https://huggingface.co/instructlab/granite-7b-lab/resolve/main/model-00001-of-00003.safetensors?download=true -o /tmp/model/model-00001-of-00003.safetensors
oc --namespace minio exec "${pod}" -- curl -L https://huggingface.co/instructlab/granite-7b-lab/resolve/main/model-00002-of-00003.safetensors?download=true -o /tmp/model/model-00002-of-00003.safetensors
oc --namespace minio exec "${pod}" -- curl -L https://huggingface.co/instructlab/granite-7b-lab/resolve/main/model-00003-of-00003.safetensors?download=true -o /tmp/model/model-00003-of-00003.safetensors
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/model.safetensors.index.json?download=true -o /tmp/model/model.safetensors.index.json
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/special_tokens_map.json?download=true -o /tmp/model/special_tokens_map.json
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/tokenizer.json?download=true -o /tmp/model/tokenizer.json
oc --namespace minio exec "${pod}" -- curl -L https://huggingface.co/instructlab/granite-7b-lab/resolve/main/tokenizer.model?download=true -o /tmp/model/tokenizer.model
oc --namespace minio exec "${pod}" -- curl https://huggingface.co/instructlab/granite-7b-lab/resolve/main/tokenizer_config.json?download=true -o /tmp/model/tokenizer_config.json
#+end_src


#+begin_src tmux
# Retreieve the pod name
pod=$(oc get pods --namespace "minio" --output name)

# Upload files via minio cli
oc --namespace "minio" exec "${pod}" -- mc cp --recursive /tmp/model local/models/granite-7b-lab
#+end_src
4 changes: 2 additions & 2 deletions data/hackathon/scenario1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The bank is currently going through a "bake off" evaluating multiple options for

Your hackathon team are the pre-sales technical team engaging with various ACME teams and leadership to try and win the bake off, securing buy-in for a large scale OpenShift AI deployment to proceed.

We're chasing a $5 million AUD deal. Each of the challenges you complete during this hackathon will secure an $AUD portion of this deal. At your disposal is a very expensive OpenShift and OpenShift AI contractor - whose services come at a cost of $25,000 AUD per hour of engagement. You may engage them at various points throughout the challenges, but their costs will be deducted from the deal value you secure.
We're chasing a `$5` million AUD deal. Each of the challenges you complete during this hackathon will secure an $AUD portion of this deal. At your disposal is a very expensive OpenShift and OpenShift AI contractor - whose services come at a cost of `$25,000` AUD per hour of engagement. You may engage them at various points throughout the challenges, but their costs will be deducted from the deal value you secure.

The winner will be the team with the highest deal secured.

Expand Down Expand Up @@ -78,4 +78,4 @@ If you get stuck on a question, fear not, perhaps try a different approach. If y

> [team name] are stuck on [exercise] and are engaging contractor support.

A hackathon organiser will join your breakout room to put the expensive contractor to work (bear in mind it will cost $25k AUD!) 😂
A hackathon organiser will join your breakout room to put the expensive contractor to work (bear in mind it will cost `$25k` AUD!) 😂
Loading