Skip to content

Comments

Feature/grip updates#78

Merged
matthewpeterkort merged 12 commits intoohsu-developfrom
feature/grip-updates
May 15, 2025
Merged

Feature/grip updates#78
matthewpeterkort merged 12 commits intoohsu-developfrom
feature/grip-updates

Conversation

@matthewpeterkort
Copy link
Collaborator

@matthewpeterkort matthewpeterkort commented Mar 26, 2025

Adds gecko service for config wrangling. See https://github.com/ACED-IDP/gecko
Swaps mongo driver for grip grids driver, thus removing mongodb service.
Re configures ETL routing from /graphql to /writer so that /graphql can be used for grip graphql reader

nginx.ingress.kubernetes.io/proxy-body-size: 10240m
needs to be added to ingress to allow for larger body sizes.

this should be added to the annotations section with kubectl edit ingress revproxy-dev -n default

@quinnwai
Copy link

If we're planning to do a release using this gen3-helm PR, can we move the Kafka work to another branch? If I recall correctly, the Kafka work was a proof of concept anyways.

@lbeckman314 lbeckman314 self-assigned this May 9, 2025
@lbeckman314 lbeckman314 added the enhancement New feature or request label May 9, 2025
@lbeckman314
Copy link
Collaborator

lbeckman314 commented May 9, 2025

Testing Steps (Creating Local K8s Cluster):

1. Start Docker Desktop ✅

➜ open -a Docker

2. Create Kind Cluster ✅

kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name:  kind-multi-node
networking:
  ipFamily: ipv4
  apiServerAddress: 127.0.0.1
nodes:
  - role: control-plane
    kubeadmConfigPatches:
      - |
        kind: InitConfiguration
        nodeRegistration:
          kubeletExtraArgs:
            node-labels: "ingress-ready=true"
    extraPortMappings:
      - containerPort: 80
        hostPort: 80
        protocol: TCP
      - containerPort: 443
        hostPort: 443
        protocol: TCP
kind create cluster --config kind-config.yaml

3. Create Ingress NGINX Controller

kubectl apply --filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

kubectl wait --namespace ingress-nginx \
  --for=condition=ready pod \
  --selector=app.kubernetes.io/component=controller \
  --timeout=90s

4. Update /etc/hosts

Added to /etc/hosts:

127.0.0.1 calypr.ohsu.edu

5. Update Makefile

# Update Makefile (replace 'rancher-desktop' with 'kind-kind-multi-node')
➜ sed -i '' 's/rancher-desktop/kind-kind-multi-node/g' Makefile

➜ make clean

@lbeckman314
Copy link
Collaborator

lbeckman314 commented May 10, 2025

Note

Thanks @matthewpeterkort for unblocking the local SSL issue that allowed the local testing to continue!

Caution

Only a basic "Hello, World!" file was tested for upload and download (no rich metadata)

Warning

These steps were run with OHSU's fork of gen3-client to avoid the the mismatch issue between a file's uploaded path and it's GUID in Indexd

Overview

  • Expected services up and running on local deployment (with minor image tag change above) ✅
  • Data upload not yet tested (blocked by SSL issue with local K8s cluster) ⚠️

Testing Steps (Gecko + GRIP/GRIDS)

1. Update Secrets ✅

➜ scp -r <cbds-prod>:/cbds/gen3-helm/Secrets ./Secrets-local

➜ ln -s Secrets-local Secrets

# Enable Gecko Serviceecho "gecko:\n  enabled: true" >> Secrets/values.yaml

2. Update Dependencies ✅

➜ gh pr checkout 78
branch 'feature/grip-updates' set up to track 'origin/feature/grip-updates'.
Switched to a new branch 'feature/grip-updates'

➜ helm dependency build helm/gen3

➜ make update

3. Deploy ✅

➜ make local
Switched to context "kind-kind-multi-node".
Deploying local
...
NAMESPACE: default
STATUS: deployed
REVISION: 1

4. Verify calypr.ohsu.edu resolves to localhost

➜ ping calypr.ohsu.edu
PING calypr.ohsu.edu (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.066 ms
...

5. Wait for Pods to be ready ✅

Wait ~20 Minutes from fresh install (mainly waiting for all images to be pulled)...

6. Verify Gecko Service ⚠️

Adds gecko service for config wrangling. See https://github.com/ACED-IDP/gecko

➜ kubectl get deployment/gecko-deployment
NAME               READY   UP-TO-DATE   AVAILABLE
gecko-deployment   0/1     1            0

➜ kubectl logs deployment/gecko-deployment
Failed to connect to database: dial tcp [::1]:5432: connect: connection refused ❌ 

Updating the image tag to latest resolves the Database Connection issue:

➜ kubectl delete jobs local-gecko-db-init

➜ make local

➜ kubectl get deployment/gecko-deployment
NAME               READY   UP-TO-DATE   AVAILABLE
gecko-deployment   1/1     1            1 ✅ 

➜ kubectl logs deployment/gecko-deployment
gecko serving at :80
server.go:201: INFO: Health check passed ✅ 

7. Verify GRIP + GRIDS Service

Swaps mongo driver for grip grids driver, thus removing mongodb service.

➜ kubectl get deployment/grip-deployment
NAME              READY   UP-TO-DATE   AVAILABLE
grip-deployment   1/1     1            1

➜ kubectl logs deployment/grip-deployment
{
  "data": 200,
  "graph": "",
  "level": "info",
  "msg": "[200] healthy _status",
  "status": 200,
}

8. Verify ETL Routing (/writer) ✅

Re configures ETL routing from /graphql to /writer so that /graphql can be used for grip graphql reader

➜ kubectl port-forward svc/grip-service 8201:8201
Forwarding from 127.0.0.1:8201 -> 8201
Forwarding from [::1]:8201 -> 8201

# Writer Endpoint
➜ curl localhost:8201/writer/
{
  "data": null,
  "message": " Not Found",
  "status": "404"
}

# GraphQL Endpoint
➜ curl localhost:8201/graphql/
<!DOCTYPE html>
<html>
  <head>
        <meta charset="utf-8">
        <title>GraphQL Playground</title>
        ...

9. Upload Basic File ✅

Download new Profile Credentials from https://calypr.ohsu.edu/Profile (~/Downloads/credentials.json)

➜ mv ~/Downloads/credentials.json ~/.gen3/credentials.json.local

➜ g3t --version
g3t, version 0.0.7rc12

➜ gen3-client configure --profile=local --cred=~/.gen3/credentials.json.local --apiendpoint=https://calypr.ohsu.edu
Profile 'local' has been configured successfully.

➜ export G3T_PROFILE=local

➜ g3t ping
Connected using profile:local'
endpoint: https://calypr.ohsu.edu
bucket_programs:                                                                                                                                                              cbds: cbds
  gdcdata: gdc
  get3test: fortera
  smmart-caliper-dev: smmart
your_access:
  /data_file: update,file_upload,create,write-storage,*,delete
  /mds_gateway: access
  /programs: create,read,update,*
  /programs/cbds: create,read,update,*
  /programs/cbds/projects: create,read,update,*
  /programs/cbds/projects/test: create,read,update,*
  /services/sheepdog/submission/program: '*'                                                                                                                                  /services/sheepdog/submission/project: '*'                                                                                                                                  /sower: create,access,read,update                                                                                                                                           /workspace: access,update,file_upload,create,write-storage,*,read,read-storage,delete

➜ mkdir cbds-test

➜ cd cbds-test

➜ g3t init cbds-testing
Approval needed. to approve the project, a privileged user must run `g3t collaborator approve --all`

➜ g3t collaborator approve --all
approved:
- policy_id: programs.cbds.projects.testing_writer
  status: SIGNED
- policy_id: programs.cbds.projects.testing_reader
  status: SIGNED
msg: OK

➜ echo 'Hello, World!' > hello-world.txt && date >> hello-world.txt

➜ cat hello-world.txt
Hello, World!
Mon May 12 16:51:00 PDT 2025

➜ g3t add hello-world.txt

➜ g3t meta init
Updated 2 metadata files.
resources={'summary': {'DocumentReference': 1, 'ResearchStudy': 1}} exceptions=[]

➜ g3t commit -m "add file"
[main fd298d8] add file
 4 files changed, 26 insertions(+)
 create mode 100644 MANIFEST/hello-world.txt.dvc
 create mode 100644 META/DocumentReference.ndjson
 create mode 100644 META/ResearchStudy.ndjson

➜ g3t push
{'summary': {'DocumentReference': 1, 'ResearchStudy': 1}}
Scanned new: 1, updated: 0 files
Published project. Logs found at logs/publish.log

10. Verify Data Upload in S3 ✅

➜ g3t ls
bucket:
...
- did: d70d5a79-2f88-5d0d-9ed0-fd0bb6ddd6fe
  file_name: hello-world.txt
  indexd_created_date: '2025-05-13T00:01:43.914352'
  meta:
    object_id: d70d5a79-2f88-5d0d-9ed0-fd0bb6ddd6fe
  urls:
  - s3://cbds/d70d5a79-2f88-5d0d-9ed0-fd0bb6ddd6fe/hello-world.txt
...

➜ mc ls cbds/cbds/d70d5a79-2f88-5d0d-9ed0-fd0bb6ddd6fe/hello-world.txt
[2025-05-12 17:01:46 PDT]    43B STANDARD hello-world.txt

➜ mc cat cbds/cbds/d70d5a79-2f88-5d0d-9ed0-fd0bb6ddd6fe/hello-world.txt
Hello, World!
Mon May 12 16:51:00 PDT 2025

11. Download Basic File ✅

➜ mkdir clone-test

➜ cd clone-test

➜ g3t clone cbds-testing
Cloned .g3t/work/cbds-testing.git.zip
On branch main
nothing to commit, working tree clean

➜ cd cbds-testing

➜ ls
MANIFEST META

➜ g3t pull
2025/05/12 17:05:51 File info prepared successfully
hello-world.txt  43 B / 43 B
2025/05/12 17:05:52 1 files downloaded.

➜ ls
MANIFEST        META            hello-world.txt

➜ cat hello-world.txt
Hello, World!
Mon May 12 16:51:00 PDT 2025

lbeckman314
lbeckman314 previously approved these changes May 13, 2025
@matthewpeterkort matthewpeterkort merged commit 819da0b into ohsu-develop May 15, 2025
1 check failed
@matthewpeterkort matthewpeterkort deleted the feature/grip-updates branch May 15, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants