Skip to content

Commit

Permalink
3668 link devs to openstack (#3749)
Browse files Browse the repository at this point in the history
Co-authored-by: dgauldie <[email protected]>
  • Loading branch information
dgauldie and dgauldie authored Jun 4, 2024
1 parent ee4f013 commit 02cc440
Show file tree
Hide file tree
Showing 25 changed files with 1,134 additions and 776 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ To generate the typescript models as a single command:
yarn workspace @uncharted/server-type-generator run generateTypes
```

The client, when running with the command `yarn dev`, connects to the server in the staging environment, enabling client-side development without the need to spin up the server locally.
The client, when running with the command `yarn dev`, connects to the server in the dev environment, enabling client-side development without the need to spin up the server locally.

To run the client while connecting to the server running locally, use the following command:

Expand Down
8 changes: 4 additions & 4 deletions containers/scripts/docker-compose-hmi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ services:
# GITHUB_URL: https://api.github.com
# JSDELIVR_URL: https://cdn.jsdelivr.net
# MIRA-API_URL: http://34.230.33.149:8771
# MIT-PROXY_URL: https://mit-proxy.staging.terarium.ai
# SKEMA-PY_URL: https://skema-py.staging.terarium.ai
# SKEMA-RS_URL: https://skema-rs.staging.terarium.ai
# SKEMA-UNIFIED_URL: https://skema-unified.staging.terarium.ai
# MIT-PROXY_URL: https://mit-proxy.dev.terarium.ai
# SKEMA-PY_URL: https://skema-py.dev.terarium.ai
# SKEMA-RS_URL: https://skema-rs.dev.terarium.ai
# SKEMA-UNIFIED_URL: https://skema-unified.dev.terarium.ai
# XDD-DEV-SERVICE_URL: https://xdddev.chtc.io
# XDD-PROD-SERVICE_URL: https://xdd.wisc.edu
depends_on:
Expand Down
94 changes: 45 additions & 49 deletions containers/secrets.env.encrypted
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
$ANSIBLE_VAULT;1.1;AES256
37393138363663633036663466663737646333646230333766633139376463383131333433646563
6438646234343638383765636366333633623932333035340a656632626337616238393739613238
64363632313664613233303865343662366262353831353935373534336262626239316137316362
6339323565333931650a663830343162636366323563343835613139613431643332306261316332
64353936383539383232636665353562343161616430343330373866613139663931666466663766
64616664346230666661666235333830633734386533613438316136333766366239353433613365
34353839336339643165313764396434366535363033313336633735303037656466333233653035
66353731343066333965663462633638396463623463626630303963313333366331313062636433
64663562366562653635643139343131313765393537343032613436323336626336356432613164
34653132346430643135623734626265396263396433663833363163366139393733326462613935
38643461633337383364383562306566643535353364663637626264626365646535353865636131
32316465316639346630653839386565636461363336366339303836323433363763666261613836
37343238633635626364396266393431653735333730623764336432643063373838366161303637
38383132386261616534643932646236333831333363336664663536306436313135333733323739
39313234313164653931353334646265393234376262656236393733666334393765636162353165
32343737663839316634363137616163656239613035313539396236343965346466366663336564
37653135656362316434336135323731396134626132373466353265613062343463373537663365
63656332623966636439333762633738353362346434333731633334643932383761323535633937
65313434363932616164343234393038376233663239356336366664306136336635346564303630
32663065373031353035623837346562396633666363393331313134386464663831666637643661
63636564383461333439306565343738396261376361373234323433623532373030653731383562
31313966663730356563653234633761613038646163303665656261333835313932613362613533
66663062323534346263376130323630383031343038356435643538636665313432613764643131
66396539393031626236333565623062303232623363633632303434626664373435353364323966
30323936663631386364616431316331656634323636343433353636356463333639393036613533
37333732623032313735363633346363633066303565316437343231316636313134316633373761
63646563316366343362646561633637323530653364343263626633336539646163633561383335
34613862393031616362386661353630393430383935373838663031363563643566393138393461
30636130616331616164306363366565353837623061356265366236363733633735306537356261
32366331613135656163393930663563326139333961363338393565346130323337633966383931
39333431393566626562653137663938623336383231626162643063636232626361323535626538
38393033366131383133393636616437353365333562346136343038373132346466653536313732
34623538656235616436616631383833306432383736333736353434323464373333353263633561
62336164653061376135663964396533363431383763613865373564393961646266613939656465
65666132303933623336616337346464356163333238616437646430656139336461396334316262
37353763303835383438653739303365343931663330653235636230613838373464366266653134
30616463343538326261653637323162343439613466346564356631303936633830613362643866
66356133323564306237353235343436616661333938653538363236613764313730653535353034
65376135323533333637646537616335373464393739393133333739616665323864376437386635
30356561346339653835376666376437663136616230333633646161356630383834306233303839
39333265363162333664336563643365613736336534653832393563323937363331333233353531
62666264366235623962396362363231313162383530646461376534393965333439336630363230
31616639613939356634323733343633623833643036373635323061353837376361373663623461
65646166336632326636666439623239623134313864653435613838656135333163643964393233
38666533613866326561313335333238343565616561323932386134343966393139333636616266
62386563393864366231636662353736633239386263656362343832636165396130363264633831
39306462316432646233303162633365643332313766356234386633616563343561336339343564
65323835383535646465303064636136343135663938376162623639343464323333613838623334
62633066633838663335383365363063353532386264613038633232666166336563
30613836356630646138643263303632386439626634386237366239616466613131373765376632
3666383538303637393437633639303761313366343461630a323230613839313939313832343537
36643437643237613564363331366238366266356261303238343436353230393737306633663733
3930656162323839390a326166613537666535356236396337376532656131666237316537313961
66663361666565353136316339373338653466313962353431303534316464656264343539653739
61383061666432633430336331623066393065353839653331396263353162366433646163363635
65326530396263636464393135613636373235616331616564616331303433313137326330366639
31633165313030343431376232333337643236346465353935366237643262306165666165633964
31623866383564376332656566306635393130613433633438313964383865366630383932363365
66326462346137623130326262313538653038666533393133356632653438616139393738393630
35313535653930376135323661663364323935656534633539613266613838636238643264326165
62323563366231333038663366376263636166353935623930626437396365623430303032373664
38336161313437386433653766393265613364383836343939613630363132653837333433363637
64386539643330336530663063326662336435363537396562613838656231326434373363393462
32636637353536613263323439343737326636666563323632396439383833396438373334346132
65353234663762363535363730376334396332373064666239646364353238653337653061656562
66376635326361306363653933663164383432303933383965343839643930656535393938363932
31376537313634356430323134343761633762363231343835663330633439646463376338353362
63316130343462323966663937323534353434313238373832636361306263636165346166613531
36323265373638333337623634653832383233366335386162373466373339633164346563376464
65353462633633383764646663636231633032346564623431633438636461326464613834626663
38636431313664333062626261616562376366313333356537336664333364623035646666616261
64356434663036616363343263613432653637353936333134626330393265393732333665336630
38313665616662386231666462353138323665646331623965353263373466386462333563633332
37656631383333626436326536353833623130393531306530623435353736666566613738343332
34633037643665343331616530376130383662646166666639373466343133323537643233366331
31333564623734656661383139363732383034323766343461303431656633306138316437343637
32316138633533666262613462636133393963613736656234663338633439633730623764626531
38343866316461393833613935636130363535323064653863396436636434613732306633323231
38316162303163646265303337343339643734303633316230396361326266643034393266636537
34623963636463393562326633653363653531373666616532376338383431383662643231346433
38333733386636313365616232393033643164653266386438333864623565363631656230393266
32313038343037626338656564313463363231313331333531656663343738343435313663633234
35346638663534343131383163336235306432353235363264633862383730626535333666643337
61623232383834383366663761333331303531376636653638653938353837633764613639303966
39393133643466326461323836663964363931613730343930323835633931396236336239616362
34346165366334646164343463383361626266613366666432353265633766653232383264333862
64346130326461316135653265306134666463343063336231353565616532656562373533336432
61626537383065393830323232343330353661616363636536396332656330303062353833316161
36343030353464656532613561333437333637336661616431643964643134656134353763323537
62613664383331633135363063653436633565323830643536633061326331393038666564313932
37316266653964393232396561316563646134383463613332346665316137393562663438643136
33363937623536336337373162636438323737306235363537343863343137633036613162366664
38303636643435323866396662636361643264633835623666336538323339306334306562303239
6538
4 changes: 0 additions & 4 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ group "prod" {
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner"]
}

group "staging" {
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner"]
}

group "default" {
targets = ["hmi-client-base", "hmi-server-base", "gollm-taskrunner-base", "mira-taskrunner-base", "funman-taskrunner-base"]
}
Expand Down
21 changes: 18 additions & 3 deletions hmiServerDev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ function start_local() {
cd - || exit
}

function start_staging() {
echo "Starting local server"
cd ${SERVER_DIR} || exit
./gradlew bootRun --args='--spring.profiles.active=default,secrets,staging'
cd - || exit
}

function build_docker_compose() {
cat containers/common.env containers/secrets.env > containers/.env
docker compose --env-file containers/.env --file containers/docker-compose-full.yml $(for customfile in `ls docker-compose.custom*.y*ml 2> /dev/null`; do echo -n " -f $customfile"; done) config > ./docker-compose.yml
Expand Down Expand Up @@ -124,7 +131,7 @@ COMMAND=${COMMAND:-"help"}
ENVIRONMENT=${ENVIRONMENT:-"local"}
SERVER=${SERVER:-"false"}

VALID_ENVIRONMENTS=("local" "full" "ll")
VALID_ENVIRONMENTS=("local" "staging" "full" "ll")
ENVIRONMENT_IS_VALID=0
for env in ${VALID_ENVIRONMENTS[@]}; do
echo "checking $ENVIRONMENT against $env"
Expand All @@ -150,6 +157,9 @@ case ${COMMAND} in
local)
deploy_local
;;
staging)
deploy_local
;;
full)
deploy_full
;;
Expand All @@ -160,6 +170,8 @@ case ${COMMAND} in
if [ ${SERVER} == "run" ]; then
if [ ${ENVIRONMENT} == "local" ]; then
start_local
elif [ ${ENVIRONMENT} == "staging" ]; then
start_staging
fi
delete_secrets
fi
Expand All @@ -170,6 +182,9 @@ case ${COMMAND} in
local)
stop_local
;;
staging)
stop_local
;;
full)
stop_full
;;
Expand Down Expand Up @@ -200,14 +215,14 @@ case ${COMMAND} in
start
ENVIRONMENT
local | full | ll (default: local) Indicate which environment to develop against
local | staging | full | ll (default: local) Indicate which environment to develop against
(ll: local_lean to run local with the absolute minimal support to run hmiServer for development)
run (default: null) Indicate whether to run the server after starting the containers
stop
ENVIRONMENT
local | full (default: local) Indicate which containers to stop
local | staging | full | ll (default: local) Indicate which containers to stop
OTHER COMMANDS:
encrypt
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": "yarn workspaces foreach --all --parallel --interlaced --verbose --topological run build",
"dev": "yarn workspace hmi-client run dev",
"local": "yarn workspace hmi-client run local",
"staging": "yarn workspace hmi-client run staging",
"generateTypes": "yarn workspace @uncharted/server-type-generator run generateTypes",
"serve": "yarn workspace hmi-client run build",
"lint": "eslint . --ext .ts,.vue --fix --cache",
Expand Down
1 change: 1 addition & 0 deletions packages/client/hmi-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "yarn install && vite --host",
"local": "yarn install && vite --host --config vite.config.local.ts",
"staging": "yarn install && vite --host --config vite.config.staging.ts",
"build": "vue-tsc --noEmit && vite build",
"typecheck": "yarn workspace graph-scaffolder tsc --build && vue-tsc --noEmit",
"preview": "vite preview",
Expand Down
23 changes: 23 additions & 0 deletions packages/client/hmi-client/vite.config.staging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference types="vitest" />
import config from './vite.config';

config.server.proxy = {
'^/api': {
target: 'https://server.staging.terarium.ai',
rewrite: (path_str) => path_str.replace(/^\/api/, ''),
changeOrigin: true
},
'^/beaker': {
target: 'https://beaker.staging.terarium.ai',
changeOrigin: true,
rewrite: (path_str) => path_str.replace(/^\/beaker/, '')
},
'^/beaker_ws': {
target: 'ws://beaker.staging.terarium.ai',
ws: true,
changeOrigin: true,
rewrite: (path_str) => path_str.replace(/^\/beaker/, '')
}
};

export default config;
6 changes: 3 additions & 3 deletions packages/client/hmi-client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ export default defineConfig({
},
proxy: {
'^/api': {
target: 'https://server.staging.terarium.ai',
target: 'https://server.dev.terarium.ai',
rewrite: (path_str) => path_str.replace(/^\/api/, ''),
changeOrigin: true
},
'^/beaker': {
target: 'https://beaker.staging.terarium.ai',
target: 'https://beaker.dev.terarium.ai',
changeOrigin: true,
rewrite: (path_str) => path_str.replace(/^\/beaker/, '')
},
'^/beaker_ws': {
target: 'ws://beaker.staging.terarium.ai',
target: 'ws://beaker.dev.terarium.ai',
ws: true,
changeOrigin: true,
rewrite: (path_str) => path_str.replace(/^\/beaker/, '')
Expand Down
6 changes: 3 additions & 3 deletions packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ class Parent {
class Child {

@Id
private UUID id = UUID.randomUUID();
private final UUID id = UUID.randomUUID();

};
}
```

## Migrations:

There are two "passes" for migrations in the app.

1) For local, staging, and prod we have `spring.jpa.hibernate.ddl-auto=update`. On server startup Hibernate will update the schema if it detects that the entities and tables/columns are out of sync. It will add new tables/columns and update existing ones as needed, but it won't delete any existing tables or columns.
1) For local, dev, staging, and prod we have `spring.jpa.hibernate.ddl-auto=update`. On server startup Hibernate will update the schema if it detects that the entities and tables/columns are out of sync. It will add new tables/columns and update existing ones as needed, but it won't delete any existing tables or columns.

This ensures that new tables are created and new columns are added. However this leaves the case of _modifying existing columns_.

Expand Down
Loading

0 comments on commit 02cc440

Please sign in to comment.