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

Aggies sprint9 staging merge #100

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
899c22f
Remove unused config and update default user
wwelling Oct 18, 2024
6e504bc
Update default login and response handler
wwelling Oct 18, 2024
002ac3b
Access workflows through okapi
wwelling Oct 19, 2024
6840142
Update submodules with Kafka
wwelling Oct 19, 2024
561a5d7
Update Vagrantfile
wwelling Oct 19, 2024
b882b9a
Update README.md
wwelling Oct 19, 2024
54a72cf
Update package.json
wwelling Oct 19, 2024
3dba885
Merge branch 'aggies-sprint9-kafka' of github.com:TAMULib/fw-cli into…
wwelling Oct 19, 2024
f52c4c2
Update package.json
wwelling Oct 19, 2024
ce8e660
Update Vagrantfile
wwelling Oct 19, 2024
b807cc7
Update mod-camunda submodule with update module descriptor
wwelling Oct 19, 2024
6cae079
Update submodules
wwelling Oct 19, 2024
da4a8ca
Update mod-workflow and mod-camunda submodules
wwelling Oct 19, 2024
0b73684
Update mod-workflow submodule
wwelling Oct 19, 2024
48e2326
Add setup script to deploy development modules
wwelling Oct 21, 2024
4c8ddbd
Update mod-camunda
wwelling Oct 21, 2024
ee36815
Add mod-workflow and mod-camunda permissions info to the READ.md
wwelling Oct 21, 2024
47f4a58
Update submodules for requested changes
wwelling Oct 21, 2024
8869e92
Update mod-workflow submodule
wwelling Oct 21, 2024
f384e3a
Update submodules for more change requests
wwelling Oct 21, 2024
a3dbba9
Update README.md
wwelling Oct 21, 2024
d9b9e07
Update spring-module-core
wwelling Oct 22, 2024
5230a86
Add console,log for setup to indicate reading module descriptor
wwelling Oct 22, 2024
b916cd7
Merge pull request #96 from TAMULib/aggies-sprint9-91-through-okapi
wwelling Oct 22, 2024
3fe5d14
Update submodules to staging
wwelling Oct 22, 2024
0b37649
Update submodules
wwelling Oct 24, 2024
5f1fb7d
Remove authorship and update license
wwelling Oct 24, 2024
a0ebb39
Update mod-camunda
wwelling Oct 24, 2024
f8df8f2
Update mod-camunda
wwelling Oct 24, 2024
4aafed7
Correct log
wwelling Oct 25, 2024
71c42ea
Add readme section for kafka-ui and update Vagrantfile port mapping
wwelling Oct 25, 2024
dbc64cd
Update README.md
wwelling Oct 25, 2024
15a85c2
Use generic absolute path for synced directory
wwelling Nov 11, 2024
de0eae1
Merge branch 'main' of github.com:TAMULib/fw-cli into aggies-sprint9-…
wwelling Nov 19, 2024
572612e
Add access config
wwelling Nov 19, 2024
d316b04
Make it safe
wwelling Nov 19, 2024
8b9fc48
Update okapi.service.ts
wwelling Nov 19, 2024
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 William Welling
Copyright (c) 2024 Texas A&M University Libraries

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
103 changes: 103 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,109 @@ yarn okapi
vagrant up release
```

## Building images for deployment

Update `Vagrantfile` with a synced directory to fw-cli for mod-workflow and mod-camunda development.

```
snapshot.vm.synced_folder "C:/Users/FOLIO/Development/work/FOLIO/fw-cli", "/home/vagrant/fw-cli", owner: "vagrant", group: "vagrant", mount_options: ["uid=1000", "gid=1000"]
```
> ***Be sure to update the host machine path.***
## Running FOLIO Locally

```
vagrant up snapshot
```

Wait for Okapi to start all the modules.

```
vagrant ssh snapshot
```

Check to see if Okapi is ready.
```
docker logs okapi -n 100 -f
```

Goto http://localhost:3000 and login.


## Build the jar file and descriptors on the host machine

```
cd spring-module-core
# git checkout <branch>
mvn clean package
cd ../mod-workflow
# git checkout <branch>
mvn clean package
cd ../mod-camunda
# git checkout <branch>
mvn clean package
```

## Build the docker images on the folio/snapshot vagrant docker client

```
vagrant ssh snapshot
```

From `/home/vagrant`:
```
cd fw-cli
cd mod-workflow
docker build -t docker.ci.folio.org/mod-workflow:1.2.0-SNAPSHOT .
cd ../mod-camunda
docker build -t docker.ci.folio.org/mod-camunda:1.2.0-SNAPSHOT .
```

> ***Update versions according to corresponding pom.xml***

## Run mod-workflow and mod-camunda with folio/snapshot

A bare minimum setup script `setup.js` is available to perform the necessary requests to run the modules with Okapi. This requires the previous steps of building jar files and module descriptors on the host and building the Docker images on the Vagrant VM.

From `/home/vagrant/fw-cli`:
```
node ./setup.js
```

## Update user permissions for mod-workflow and mod-camunda

The following permissions are required. There is additional ui-workflow permissions required when bundling and running ui-workflow with stripes. This is not yet available in folio/snapshot and is not provided here.

```
"workflow.actions.all",
"workflow.events.all",
"workflow.nodes.all",
"workflow.nodes.item.post",
"workflow.triggers.all",
"workflow.tasks.all",
"workflow.workflows.all",
"camunda.history.all",
"camunda.message.all",
"camunda.process.all",
"camunda.process-definition.all",
"camunda.decision-definition.all",
"camunda.task.all",
"camunda.workflow-engine.workflows.all"
```

## Watch Kafka broker

```
docker run -d --name kafka-ui --user 1000:1000 -p 8080:8080 -e KAFKA_CLUSTERS_0_NAME=folio -e KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=10.0.2.15:9092 -e KAFKA_CLUSTERS_0_ZOOKEEPER=10.0.2.15:2181 provectuslabs/kafka-ui:latest
```

Open http://localhost:8080 in the browser to see the kafka-ui interface.

## Running Workflow Modules Locally

```
Expand Down
64 changes: 44 additions & 20 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,62 @@ Vagrant.configure(2) do |config|
end

config.vm.provider "virtualbox" do |vb|
vb.memory = 12288
vb.cpus = 4
end

# https://app.vagrantup.com/folio/boxes/snapshot-backend-core
config.vm.define "snapshot-backend-core", autostart: false do |snapshot_backend_core|
snapshot_backend_core.vm.box = "folio/snapshot-backend-core"
end

# https://app.vagrantup.com/folio/boxes/snapshot-core
config.vm.define "snapshot-core", autostart: false do |snapshot_core|
snapshot_core.vm.box = "folio/snapshot-core"
vb.memory = 36864
vb.cpus = 8
end

# https://app.vagrantup.com/folio/boxes/snapshot
config.vm.define "snapshot", autostart: false do |snapshot|
snapshot.vm.box = "folio/snapshot"
end

# https://app.vagrantup.com/folio/boxes/testing-backend
config.vm.define "testing-backend", autostart: false do |testing_backend|
testing_backend.vm.box = "folio/testing-backend"
end
snapshot.vm.synced_folder "C:/Users/FOLIO/fw-cli", "/home/vagrant/fw-cli", owner: "vagrant", group: "vagrant", mount_options: ["uid=1000", "gid=1000"]

# https://app.vagrantup.com/folio/boxes/testing
config.vm.define "testing", autostart: false do |testing|
testing.vm.box = "folio/testing"
# okapi
snapshot.vm.network "forwarded_port", guest: 9130, host: 9130
# stripes
snapshot.vm.network "forwarded_port", guest: 3000, host: 3000
#
snapshot.vm.network "forwarded_port", guest: 8000, host: 8130
# kafka-ui
snapshot.vm.network "forwarded_port", guest: 8080, host: 8080
# postgres
snapshot.vm.network "forwarded_port", guest: 5432, host: 5432
# kafka
# snapshot.vm.network "forwarded_port", guest: 9092, host: 9092
# kafka
# snapshot.vm.network "forwarded_port", guest: 29092, host: 29092
# zookeeper
# snapshot.vm.network "forwarded_port", guest: 2181, host: 2181
#
# snapshot.vm.network "forwarded_port", guest: 9001, host: 9001
# snapshot.vm.network "forwarded_port", guest: 9002, host: 9002
end

# https://app.vagrantup.com/folio/boxes/release
config.vm.define "release", autostart: false do |release|
release.vm.box = "folio/release"

release.vm.synced_folder "C:/Users/FOLIO/fw-cli", "/home/vagrant/fw-cli", owner: "vagrant", group: "vagrant", mount_options: ["uid=1000", "gid=1000"]

# okapi
release.vm.network "forwarded_port", guest: 9130, host: 9130
# stripes
release.vm.network "forwarded_port", guest: 3000, host: 3000
#
release.vm.network "forwarded_port", guest: 8000, host: 8130
# kafka-ui
release.vm.network "forwarded_port", guest: 8080, host: 8080
# postgres
release.vm.network "forwarded_port", guest: 5432, host: 5432
# kafka
# release.vm.network "forwarded_port", guest: 9092, host: 9092
# kafka
# release.vm.network "forwarded_port", guest: 29092, host: 29092
# zookeeper
# release.vm.network "forwarded_port", guest: 2181, host: 2181
#
# release.vm.network "forwarded_port", guest: 9001, host: 9001
# release.vm.network "forwarded_port", guest: 9002, host: 9002
end

end
2 changes: 1 addition & 1 deletion mod-workflow
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "fw-cli",
"version": "1.0.1",
"description": "FOLIO Workflow CLI",
"author": "William Welling <[email protected]>",
"license": "MIT",
"main": "index.js",
"scripts": {
Expand All @@ -15,27 +14,28 @@
"fw": "bin/index.js"
},
"dependencies": {
"axios": "1.6.0",
"axios": "1.7.7",
"chalk": "4.1.2",
"clear": "0.1.0",
"commander": "8.3.0",
"commander": "9.5.0",
"compression": "1.7.4",
"conf": "10.2.0",
"core-js": "3.26.1",
"core-js": "3.38.1",
"cors": "2.8.5",
"express": "4.18.2",
"figlet": "1.5.2",
"handlebars": "4.7.7",
"express": "4.21.0",
"figlet": "1.7.0",
"handlebars": "4.7.8",
"handlebars-loader": "1.7.3",
"path": "0.12.7",
"request": "2.88.2"
},
"devDependencies": {
"@types/commander": "2.12.2",
"@types/core-js": "2.5.5",
"@types/node": "17.0.10",
"ts-node": "10.4.0",
"@types/core-js": "2.5.8",
"@types/node": "22.5.5",
"ts-node": "10.9.2",
"tslint": "6.1.3",
"typescript": "4.5.5"
}
"typescript": "5.6.2"
},
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
}
Loading