Skip to content

Updating Dev

Stuart Marshall edited this page Jul 23, 2024 · 1 revision

Accessing the Cluster

You need to have access to the cluster gke_everything-219816_europe-west2-a_everything-1

Set context

First set the context
kubectl config use-context gke_everything-219816_europe-west2-a_everything-1
Then set the namespace
kubectl config set-context --current --namespace=fat-crl-dev

Update Flux

Flux should update itself automatically but you can force an update by running:

	flux reconcile kustomization -n flux-system flux-system --with-source
	flux reconcile helmrelease fat-crl-dev -n fat-crl-dev --with-source

This will update coral to the latest dev version

Exec into the pod

You then need to run the update commands for coral this is done in the utility pod:

Delete the old pod
kubectl delete pod fat-crl-dev-utility
Build a new utility pod
kubectl debug $(kubectl get pods -l=tier=worker --no-headers -o custom-columns=":metadata.name" | head -n 1) -it --copy-to=fat-crl-uat-blue-utility --container=archesproject -- /bin/bash

This didn't work for me initially, an error that it could not see the pod, had to set the namespace for both the get and debug commands. This should be avoided if the namespace is set

Activate the virtual env

Run

. ../ENV/bin/activate

Update Commands

Run your update commands

python manage.py coral reload

Model Reloads

Export the data to a temp folder

python manage.py packages -o export_business_data -g 076f9381-7b00-11e9-8d6b-80000b44d1d9 -f json -d /tmp/output

Unpublish the graph

python manage.py graph unpublish -g 076f9381-7b00-11e9-8d6b-80000b44d1d9

Remove the resources

python manage.py resources remove_resources -g 076f9381-7b00-11e9-8d6b-80000b44d1d9 -y

Delete the graph

graph=076f9381-7b00-11e9-8d6b-80000b44d1d9 python manage.py shell -c "from arches.app.models.graph import Graph; import os; graph = Graph.objects.get(pk=os.getenv('graph')); print(graph); graph.delete()"

Import updated model

python manage.py packages -o import_graphs -s coral/pkg/graphs/resource_models/Monument.json

Import Data

python manage.py packages -o import_business_data -s /tmp/output/Heritage_Asset_2024-07-10_21-28-01.json  -ow overwrite

Reindex Database

python manage.py es reindex_database

Apply Sets

python manage.py apply_sets