Skip to content

Commit

Permalink
Merge branch 'main' into unit-test-script
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Oct 8, 2024
2 parents 96cebfe + 7b68e3c commit 1f8743b
Show file tree
Hide file tree
Showing 214 changed files with 259 additions and 29,216 deletions.
27 changes: 1 addition & 26 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
},
"forwardPorts": [
2432, 3000, 3306, 3333, 4200, 4211, 5200, 5432, 5601, 7010, 7443, 7200, 7888, 8010, 8071, 8000,
8080, 8081, 8082, 8083, 8084, 8085, 8086, 8090, 8091, 8092, 8200, 8787, 8888, 8889, 9090, 9104,
9200, 9411, 27017
8080, 8081, 8082, 8084, 8085, 8086, 8090, 8200, 8888, 8889, 9090, 9104, 9200, 9411, 27017
],
"portsAttributes": {
"2432": {
Expand Down Expand Up @@ -108,10 +107,6 @@
"label": "openchallenges-opensearch-dashboards",
"onAutoForward": "silent"
},
"6787": {
"label": "synapse-rstudio",
"onAutoForward": "silent"
},
"7010": {
"label": "schematic-api-docs",
"onAutoForward": "silent"
Expand Down Expand Up @@ -140,10 +135,6 @@
"label": "openchallenges-schema-registry",
"onAutoForward": "silent"
},
"8080": {
"label": "openchallenges-keycloak",
"onAutoForward": "silent"
},
"8081": {
"label": "openchallenges-service-registry",
"onAutoForward": "silent"
Expand All @@ -152,10 +143,6 @@
"label": "openchallenges-api-gateway",
"onAutoForward": "silent"
},
"8083": {
"label": "openchallenges-user-service",
"onAutoForward": "silent"
},
"8084": {
"label": "openchallenges-organization-service",
"onAutoForward": "silent"
Expand All @@ -172,18 +159,6 @@
"label": "openchallenges-config-server",
"onAutoForward": "silent"
},
"8091": {
"label": "openchallenges-auth-service",
"onAutoForward": "silent"
},
"8092": {
"label": "openchallenges-core-service",
"onAutoForward": "silent"
},
"8787": {
"label": "openchallenges-rstudio",
"onAutoForward": "silent"
},
"8888": {
"label": "openchallenges-notebook",
"onAutoForward": "silent"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ env:
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
NX_CLOUD_ENV_NAME: 'linux'
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
HEAD_REPOSITORY: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}

Expand Down Expand Up @@ -67,7 +65,7 @@ jobs:
- name: Publish the images of the affected projects
run: |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
&& echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin ghcr.io \
&& echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin \
&& nx affected --target=publish-image"
- name: Remove the dev container
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: release

on:
push:
tags:
- 'agora/v*'
- 'openchallenges/v*'

permissions:
packages: write

env:
PRODUCT: ''
VERSION: ''

jobs:
deploy:
runs-on: ubuntu-22.04-4core-16GBRAM-150GBSSD
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Extract product and version from Git tag
run: |
# Extract the product name (part before the first slash) and version (part after the first slash)
PRODUCT=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f1)
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f2)
# Output extracted values for the rest of the job
echo "PRODUCT=${PRODUCT}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- name: Set up the dev container
uses: ./.github/actions/setup-dev-container

- name: Build the Docker images for the specified product
run: |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
&& export VERSION=${{ env.VERSION }} \
&& echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin \
&& nx run-many --target=build-image --projects=${{ env.PRODUCT }}-* --configuration=ci"
23 changes: 17 additions & 6 deletions apps/openchallenges/apex/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,24 @@
"build-image": {
"executor": "@nx-tools/nx-container:build",
"options": {
"context": "apps/openchallenges/apex",
"metadata": {
"images": ["ghcr.io/sage-bionetworks/openchallenges-apex"],
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
"context": "{projectRoot}"
},
"configurations": {
"local": {
"metadata": {
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
}
},
"push": false
}
"ci": {
"metadata": {
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
"tags": ["type=semver,pattern={{version}},value=${VERSION}", "type=sha"]
},
"push": true
}
},
"defaultConfiguration": "local"
},
"publish-image": {
"executor": "@nx-tools/nx-container:build",
Expand Down
1 change: 0 additions & 1 deletion apps/openchallenges/api-gateway/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
SERVER_PORT=8082
KEYCLOAK_URL=http://openchallenges-keycloak:8080
SERVICE_REGISTRY_URL=http://openchallenges-service-registry:8081/eureka
2 changes: 0 additions & 2 deletions apps/openchallenges/api-gateway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ dependencies {
implementation "org.sagebionetworks.openchallenges:openchallenges-app-config-data:${openchallengesVersion}"
implementation "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-security:${springBootVersion}"
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin:${springCloudVersion}"
implementation "org.springframework.cloud:spring-cloud-starter-config:${springCloudVersion}"
Expand Down
48 changes: 2 additions & 46 deletions apps/openchallenges/api-gateway/requests.http
Original file line number Diff line number Diff line change
@@ -1,55 +1,11 @@
@serviceRegistryHost = http://openchallenges-service-registry:8081
@apiGatewayHost = http://openchallenges-api-gateway:8082
@userServiceHost = http://openchallenges-user-service:8083
@keycloakHost = http://localhost:8080

### Check API gateway actuator (expected to redirect to Keycloak login page)
### Check API gateway actuator

GET {{apiGatewayHost}}/actuator

### Check service registry info

GET {{serviceRegistryHost}}/actuator/info

### Check user service info

GET {{userServiceHost}}/actuator/info

### Check user service info via the API gateway (expected to redirect to
### Keycloak login page)

GET {{apiGatewayHost}}/user/actuator/info

### Get access token from Keycloak

@clientId = challenge-core-client
@clientSecret = O0cNRMWg3LHsdHW8BNPlY96qKooDPhPX
@username = luke
@password = changeme

# @name login

POST {{keycloakHost}}/realms/test/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded

grant_type=password
&scope=email
&client_id={{clientId}}
&client_secret={{clientSecret}}
&username={{username}}
&password={{password}}

### Check user service info

GET {{apiGatewayHost}}/user/actuator/info
Authorization: Bearer {{login.response.body.$.access_token}}

### Check API gateway info

GET {{apiGatewayHost}}/actuator/info
Authorization: Bearer {{login.response.body.$.access_token}}

### Check API gateway routes

GET {{apiGatewayHost}}/actuator/gateway/routes
Authorization: Bearer {{login.response.body.$.access_token}}
GET {{serviceRegistryHost}}/actuator/info
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
.authenticated()
.and()
.csrf()
.disable()
.oauth2Login()
.and()
.oauth2ResourceServer()
.jwt();
.disable();
return http.build();
}
}
35 changes: 0 additions & 35 deletions apps/openchallenges/app/src/app/initialize-keycloak.factory.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/openchallenges/auth-service/.env.example

This file was deleted.

32 changes: 0 additions & 32 deletions apps/openchallenges/auth-service/.gitignore

This file was deleted.

49 changes: 0 additions & 49 deletions apps/openchallenges/auth-service/build.gradle

This file was deleted.

18 changes: 0 additions & 18 deletions apps/openchallenges/auth-service/docker-compose.yml

This file was deleted.

6 changes: 0 additions & 6 deletions apps/openchallenges/auth-service/gradle.properties

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 1f8743b

Please sign in to comment.