Skip to content

Commit

Permalink
Updating makefile, setup script and quickstart doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaspadilha committed Oct 21, 2024
1 parent 895b5b2 commit f8305af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ help: ## Shows this help message
@echo -e This is the farmvibes.ai makefile. Supported targets are:\\n
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

local: cluster local-rest-api local-cache local-worker local-orchestrator local-data-ops ## Builds all images locally and deploys them into the local farmvibes.ai cluster
local: cluster restore-git-lfs local-rest-api local-cache local-worker local-orchestrator local-data-ops ## Builds all images locally and deploys them into the local farmvibes.ai cluster
[ -z $(WAIT_AT_THE_END) ] || kubectl delete pods -l backend=terravibes && \
kubectl wait --for=condition=Available deployment --timeout=300s -l backend=terravibes

revert: cluster revert-rest-api revert-cache revert-worker revert-orchestrator ## Reverts all images to the official version

restore-git-lfs:
git lfs pull

services-base: resources/docker/Dockerfile-services-base
@docker manifest inspect `$(subst FILE,$<,$(base_image_name))` || \
az acr login -n `$(subst FILE,$<,$(base_image_name)) | cut -d / -f 1 | sed 's|.azurecr.io||g'` || \
Expand Down Expand Up @@ -122,8 +125,7 @@ revert-data-ops: cluster repo-$(DATA_OPS_REPO) delete-$(DATA_OPS_DEPLOYMENT) ##
DEPLOYMENT=$(DATA_OPS_DEPLOYMENT) IMAGE_FULL_REFERENCE=$(CONTAINER_REGISTRY_BASE)/$(DATA_OPS_REPO):$(FARMVIBES_AI_IMAGE_TAG) $(MAKE) set-registry-image
DEPLOYMENT=$(DATA_OPS_DEPLOYMENT) REPLICAS=$(CURRENT_DATA_OPS_REPLICAS) make scale

local-worker: cluster local-worker-repo delete-$(WORKER_DEPLOYMENT) ## Builds and deploys a local WORKER image (enabling debug)
git lfs pull
local-worker: cluster restore-git-lfs local-worker-repo delete-$(WORKER_DEPLOYMENT) ## Builds and deploys a local WORKER image (enabling debug)
DEPLOYMENT=$(WORKER_DEPLOYMENT) IMAGE_FULL_REFERENCE=$(WORKER_REPO):$(TAG) $(MAKE) -C . set-registry-image
DEPLOYMENT=$(WORKER_DEPLOYMENT) $(MAKE) -C . disable-frozen-modules
DEPLOYMENT=$(WORKER_DEPLOYMENT) REPLICAS=$(CURRENT_WORKER_REPLICAS) make scale
Expand Down
17 changes: 17 additions & 0 deletions docs/source/docfiles/markdown/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ In order to run FarmVibes.AI cluster, you need the following:
the repository. If you already have access to the source code, then Git is
not required.

* [Git LFS](https://git-lfs.com/) to restore some of the large files in the
repository (e.g., model weights).

* [Docker](https://docs.docker.com/engine/install/ubuntu/). Make sure you can
run the docker client without running `sudo` by adding your user account to
the `docker` group (which might require a logout/login when adding oneself
Expand Down Expand Up @@ -60,6 +63,20 @@ bash ./resources/vm/setup_farmvibes_ai_vm.sh

You might needed to restart your shell session once the script finishes.

## Optional: Restore files with Git LFS

In case you did not have Git LFS installed when cloning the repository, you will need to do so
to restore the large files in the repository. Note that the last step
["Installing software dependencies](#optional-installing-software-dependencies) already installs
Git LFS.

To restore the missing files, you can run the following command in the root of the repository:

```shell
git lfs install
git lfs pull
```

## Install the FarmVibes.AI cluster

With python3.8+ and pip installed on your machine, please install
Expand Down
8 changes: 5 additions & 3 deletions resources/vm/setup_farmvibes_ai_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Update apt
sudo apt update

# Install git
# Install git and git-lfs
sudo apt install git -y

# Install python
Expand Down Expand Up @@ -49,5 +49,7 @@ fi
# Run docker without sudo
sudo usermod -aG docker $DOCKER_USER

# Install git lfs
sudo apt install git-lfs
# Run git-lfs install to restore large files
sudo apt install git-lfs -y
git lfs install
git lfs pull

0 comments on commit f8305af

Please sign in to comment.