Skip to content

Commit ef1dd2e

Browse files
committed
devops improvements
[dist] merge assembly XML/content into airavata-api [api-server] remove redundant dbinit schemas [api-server] move all templates into templates/ [api-server] move all db scripts into database_scripts/ [devcontainer] start creating full dev environ inside .devcontainer
1 parent 4428853 commit ef1dd2e

File tree

118 files changed

+911
-3531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+911
-3531
lines changed

.devcontainer/Dockerfile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:22.04 as deps
22

33
ARG TARGETARCH
44

@@ -24,7 +24,7 @@ RUN wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz \
2424
&& tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz \
2525
&& rm go1.23.0.linux-amd64.tar.gz
2626

27-
# Install Thrift 0.23
27+
# Install Thrift 0.22
2828
RUN wget https://dlcdn.apache.org/thrift/0.22.0/thrift-0.22.0.tar.gz \
2929
&& tar -xzf thrift-0.22.0.tar.gz \
3030
&& cd thrift-0.22.0 \
@@ -45,3 +45,26 @@ ENV MAVEN_HOME=/opt/maven
4545
ENV GOROOT=/usr/local/go
4646
ENV GOPATH=/home/developer/go
4747
ENV PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin:$GOROOT/bin:$GOPATH/bin
48+
49+
EXPOSE 7878 8000 17000 8050 8930 9930 8960 8962 8970 18800 19900 18889 19908
50+
51+
FROM deps AS compiler
52+
53+
COPY --chown=developer:developer .. /home/developer/workspace
54+
WORKDIR /home/developer/workspace
55+
RUN mvn clean install -DskipTests
56+
57+
58+
FROM eclipse-temurin:17-jdk AS runner
59+
WORKDIR /app
60+
61+
COPY --from=compiler /home/developer/workspace/distribution/*.tar.gz ./
62+
63+
COPY ../dev-tools/deployment-scripts/*.sh ./
64+
COPY ../vault ./vault
65+
66+
RUN chmod +x ./distribution_update.sh ./services_up.sh
67+
68+
EXPOSE 7878 8000 17000 8050 8930 9930 8960 8962 8970 18800 19900 18889 19908
69+
70+
CMD ["sh", "-c", "./distribution_update.sh && ./services_up.sh && sleep infinity"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE USER IF NOT EXISTS 'airavata'@'%' IDENTIFIED BY '123456';
2+
GRANT ALL PRIVILEGES ON *.* TO 'airavata'@'%';
3+
FLUSH PRIVILEGES;

.devcontainer/database_scripts/init/01-databases.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,6 +3519,14 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `workflow_catalog` /*!40100 DEFAULT CHA
35193519

35203520
USE `workflow_catalog`;
35213521

3522+
--
3523+
-- Current Database: `research_catalog`
3524+
--
3525+
3526+
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `research_catalog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
3527+
3528+
USE `research_catalog`;
3529+
35223530
--
35233531
-- Current Database: `app_catalog`
35243532
--

.devcontainer/database_scripts/init/06-cloud-execution-support-migration.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
USE app_catalog;
2+
13
-- Add RESOURCE_TYPE column to base table
24
ALTER TABLE `GROUP_COMPUTE_RESOURCE_PREFERENCE`
35
ADD COLUMN `RESOURCE_TYPE` VARCHAR(255) NOT NULL DEFAULT 'SLURM';

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dockerComposeFile": "docker-compose.yml",
66
"service": "devcontainer",
77
"features": {},
8-
"workspaceFolder": "/workspace",
8+
"workspaceFolder": "/home/developer/workspace",
99
"forwardPorts": [],
1010
"customizations": {
1111
"vscode": {

.devcontainer/docker-compose.yml

Lines changed: 111 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,114 @@ volumes:
1313

1414
services:
1515
devcontainer:
16-
build: .
16+
profiles:
17+
- development
18+
build:
19+
dockerfile: Dockerfile
20+
target: deps
1721
volumes:
18-
- ..:/workspace:cached
22+
- ..:/home/developer/workspace:cached
23+
- $HOME/.m2:/home/developer/.m2
24+
- $HOME/.ssh:/home/developer/.ssh
25+
networks:
26+
airavata-network:
27+
ipv4_address: 192.168.100.10
28+
extra_hosts:
29+
- "airavata.host:192.168.100.1"
30+
ports:
31+
- "7878:7878" # sharing registry service
32+
- "8000:8000" # tunnel service
33+
- "17000:17000" # tunnel service (ingress)
34+
- "8050:8050" # file service
35+
- "8930:8930" # api service
36+
- "9930:9930" # api service (TLS) !!!
37+
- "8960:8960" # cred store service
38+
- "8962:8962" # profile service
39+
- "8970:8970" # registry service
40+
- "18800:18800" # agent service (http)
41+
- "19900:19900" # agent service (gRPC)
42+
- "18889:18889" # research service (http)
43+
- "19908:19908" # research service (gRPC)
1944
command: sleep infinity
45+
46+
microservices:
47+
profiles:
48+
- staging
49+
build:
50+
dockerfile: Dockerfile
51+
target: runner
52+
volumes:
53+
- ../vault:/app/vault
2054
networks:
2155
airavata-network:
2256
ipv4_address: 192.168.100.10
2357
extra_hosts:
2458
- "airavata.host:192.168.100.1"
59+
ports:
60+
- "7878:7878" # sharing registry service
61+
- "8000:8000" # tunnel service
62+
- "17000:17000" # tunnel service (ingress)
63+
- "8050:8050" # file service
64+
- "8930:8930" # api service
65+
- "9930:9930" # api service (TLS) !!!
66+
- "8960:8960" # cred store service
67+
- "8962:8962" # profile service
68+
- "8970:8970" # registry service
69+
- "18800:18800" # agent service (http)
70+
- "19900:19900" # agent service (gRPC)
71+
- "18889:18889" # research service (http)
72+
- "19908:19908" # research service (gRPC)
73+
depends_on:
74+
- db
75+
- kafka
76+
- keycloak
77+
- rabbitmq
78+
- sshd
79+
80+
portals:
81+
build: portals
82+
volumes:
83+
- /tmp:/tmp
84+
- ./portals/pga_config.php:/var/www/html/default/config/pga_config.php
85+
networks:
86+
airavata-network:
87+
ipv4_address: 192.168.100.18
88+
extra_hosts:
89+
- "airavata.host:192.168.100.1"
90+
91+
proxy:
92+
image: nginx/nginx-ingress
93+
ports:
94+
- "8443:8443" # https keycloak
95+
- "5173:5173" # https research portal
96+
- "8008:8008" # https php portal
97+
- "8009:8009" # https django portal
98+
environment:
99+
RESEARCH_PORTAL_ADDR: "portals:5173"
100+
PHP_PORTAL_ADDR: "portals:8008"
101+
DJANGO_PORTAL_ADDR: "portals:8009"
102+
KEYCLOAK_ADDR: "keycloak:18080"
103+
volumes:
104+
- ../vault:/vault # requires /vault/server.crt and /vault/server.key for ssl termination
105+
- ./proxy/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro
106+
networks:
107+
airavata-network:
108+
ipv4_address: 192.168.100.18
109+
extra_hosts:
110+
- "airavata.host:192.168.100.1"
25111

26112
keycloak:
27-
image: keycloak/keycloak:24.0
113+
image: keycloak/keycloak:25.0
28114
restart: always
29115
environment:
30116
KEYCLOAK_ADMIN: admin
31117
KEYCLOAK_ADMIN_PASSWORD: admin
32118
ports:
33-
- "18080:8080"
34-
- "8443:8443"
119+
- "18080:18080"
35120
volumes:
36121
- ./keycloak/realm-default.json:/opt/keycloak/data/import/realm-default.json
37122
- ./keycloak/keycloak.conf:/opt/keycloak/conf/keycloak.conf
38-
- ../keystores/airavata.jks:/opt/keycloak/conf/keystores/airavata.jks
39-
command: ["start-dev", "--import-realm"]
40-
depends_on:
41-
- db
123+
command: [ "start", "--import-realm" ]
42124
networks:
43125
airavata-network:
44126
ipv4_address: 192.168.100.11
@@ -78,8 +160,6 @@ services:
78160
ports:
79161
- "5672:5672"
80162
- "15672:15672"
81-
depends_on:
82-
- db
83163
networks:
84164
airavata-network:
85165
ipv4_address: 192.168.100.13
@@ -91,7 +171,7 @@ services:
91171
restart: always
92172
hostname: zk
93173
ports:
94-
- "12181:2181"
174+
- "2181:2181"
95175
networks:
96176
airavata-network:
97177
ipv4_address: 192.168.100.14
@@ -115,8 +195,26 @@ services:
115195
extra_hosts:
116196
- "airavata.host:192.168.100.1"
117197

198+
kafka-rest:
199+
image: confluentinc/cp-kafka-rest:latest
200+
restart: always
201+
depends_on:
202+
- kafka
203+
ports:
204+
- "8082:8082"
205+
environment:
206+
KAFKA_REST_HOST_NAME: 192.168.100.19
207+
KAFKA_REST_LISTENERS: http://0.0.0.0:8082
208+
KAFKA_REST_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:9092
209+
KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
210+
networks:
211+
airavata-network:
212+
ipv4_address: 192.168.100.19
213+
extra_hosts:
214+
- "airavata.host:192.168.100.1"
215+
118216
sshd:
119-
image: dimuthuupe/sshd:1.0
217+
image: panubo/sshd
120218
restart: always
121219
volumes:
122220
- /tmp:/tmp
@@ -140,15 +238,3 @@ services:
140238
ipv4_address: 192.168.100.17
141239
extra_hosts:
142240
- "airavata.host:192.168.100.1"
143-
144-
pga:
145-
build: pga
146-
volumes:
147-
- /tmp:/tmp
148-
ports:
149-
- "8000:80"
150-
networks:
151-
airavata-network:
152-
ipv4_address: 192.168.100.18
153-
extra_hosts:
154-
- "airavata.host:192.168.100.1"
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
# Keycloak Configuration File
21
db=dev-mem
3-
4-
# HTTP/HTTPS settings
52
http-enabled=true
6-
http-port=8080
7-
https-port=8443
8-
https-key-store-file=${kc.home.dir}/conf/keystores/airavata.jks
9-
https-key-store-password=airavata
10-
11-
# Hostname configuration
3+
http-port=18080
4+
https-port=0
125
hostname-strict=false
136
hostname-strict-https=false
14-
15-
# Health and metrics
167
health-enabled=true
178
metrics-enabled=true
18-
19-
# Logging
209
log-level=INFO

.devcontainer/keycloak/realm-default.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@
957957
"alwaysDisplayInConsole" : false,
958958
"clientAuthenticatorType" : "client-secret",
959959
"secret" : "DxeMtfiWU1qkDEmaGHf13RDahCujzhy1",
960-
"redirectUris" : [ "", "/*", "https://hub.cybershuttle.org/hub/oauth_callback" ],
960+
"redirectUris" : [ "", "/*", "http://airavata.host:20000/hub/oauth_callback" ],
961961
"webOrigins" : [ "/*" ],
962962
"notBefore" : 0,
963963
"bearerOnly" : false,
@@ -1052,7 +1052,7 @@
10521052
"description" : "",
10531053
"rootUrl" : "",
10541054
"adminUrl" : "",
1055-
"baseUrl" : "https://cybershuttle.org/",
1055+
"baseUrl" : "http://airavata.host:8009/",
10561056
"surrogateAuthRequired" : false,
10571057
"enabled" : true,
10581058
"alwaysDisplayInConsole" : false,
@@ -1102,8 +1102,8 @@
11021102
"alwaysDisplayInConsole" : false,
11031103
"clientAuthenticatorType" : "client-secret",
11041104
"secret" : "m36BXQIxX3j3VILadeHMK5IvbOeRlCCc",
1105-
"redirectUris" : [ "https://cybershuttle.org/callback-url", "http://localhost/callback-url", "http://airavata.host:8008/callback-url", "https://cybershuttle.org/", "https://cybershuttle.org/auth/callback*" ],
1106-
"webOrigins" : [ "https://cybershuttle.org", "*" ],
1105+
"redirectUris" : [ "http://airavata.host:8008/callback*", "https://airavata.host:8009/auth/callback*" ],
1106+
"webOrigins" : [ "*" ],
11071107
"notBefore" : 0,
11081108
"bearerOnly" : false,
11091109
"consentRequired" : false,
@@ -1119,8 +1119,8 @@
11191119
"oidc.ciba.grant.enabled" : "false",
11201120
"client.secret.creation.time" : "1741724922",
11211121
"backchannel.logout.session.required" : "true",
1122-
"frontchannel.logout.url" : "https://cybershuttle.org/",
1123-
"post.logout.redirect.uris" : "+##https://cybershuttle.org/",
1122+
"frontchannel.logout.url" : "http://airavata.host:8009/",
1123+
"post.logout.redirect.uris" : "+##http://airavata.host:8009/",
11241124
"display.on.consent.screen" : "false",
11251125
"oauth2.device.authorization.grant.enabled" : "true",
11261126
"backchannel.logout.revoke.offline.tokens" : "false"
@@ -1922,7 +1922,7 @@
19221922
"forwardParameters" : "kc_idp_hint",
19231923
"authorizationUrl" : "https://cilogon.org/authorize",
19241924
"disableUserInfo" : "false",
1925-
"logoutUrl" : "https://cybershuttle.org/",
1925+
"logoutUrl" : "http://airavata.host:8009/",
19261926
"sendIdTokenOnLogout" : "true",
19271927
"passMaxAge" : "false"
19281928
}

.devcontainer/pga/Dockerfile

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)