Skip to content

Commit 7f2e993

Browse files
committed
remove old rest module
1 parent b0906b6 commit 7f2e993

22 files changed

Lines changed: 188 additions & 1017 deletions

File tree

.github/workflows/maven-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ jobs:
355355
356356
- name: "Build Native Quarkus Executable"
357357
run: |
358-
mvn --no-transfer-progress --batch-mode clean package -Pnative -Pci-build -DskipTests -f ./testdata-generator-quarkus-rest-app/pom.xml
358+
mvn --no-transfer-progress --batch-mode clean package -Pnative -Pci-build -DskipTests -f ./quarkus/quarkus-app/pom.xml
359359
360360
- name: 'Release Native Quarkus Executable'
361361
if: success() && contains(github.ref, 'v')
@@ -366,5 +366,5 @@ jobs:
366366
with:
367367
upload_url: ${{env.UPLOAD_URL}}
368368
asset_name: 'testdata-generator-quarkus-rest-app-runner-${{env.GIT_TAG_NAME}}-${{matrix.label}}${{matrix.exe}}'
369-
asset_path: 'testdata-generator-quarkus-rest-app/target/testdata-generator-quarkus-rest-app-runner${{matrix.exe}}'
369+
asset_path: 'quarkus/quarkus-app/target/testdata-generator-quarkus-rest-app-runner${{matrix.exe}}'
370370
asset_content_type: application/octet-stream

azure-function/.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
bin
2+
obj
3+
csx
4+
.vs
5+
edge
6+
Publish
7+
application*
8+
9+
*.user
10+
*.suo
11+
*.cscfg
12+
*.Cache
13+
project.lock.json
14+
15+
/packages
16+
/TestResults
17+
18+
/tools/NuGet.exe
19+
/App_Data
20+
/secrets
21+
/data
22+
.secrets
23+
appsettings.json
24+
local.settings.json
25+
26+
node_modules
27+
dist
28+
29+
# Local python packages
30+
.python_packages/
31+
32+
# Python Environments
33+
.env
34+
.venv
35+
env/
36+
venv/
37+
ENV/
38+
env.bak/
39+
venv.bak/
40+
41+
# Byte-compiled / optimized / DLL files
42+
__pycache__/
43+
*.py[cod]
44+
*$py.class
45+
46+
# Azurite artifacts
47+
__blobstorage__
48+
__queuestorage__
49+
__azurite_db*__.json

azure-function/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# How To Deploy Event Generator as Azure Function
2+
3+
## Prerequisites:
4+
5+
- Maven >= 3.9
6+
- An Azure Account. Free accounts work.
7+
- Azure CLI Installed
8+
- Azure Functions Core Tools version 4.x
9+
- A way to build a quarkus native executable (Graal installed or via docker build)
10+
11+
## Build quarkus-app for Azure Deployment
12+
13+
PREPARE: Setup Azure Function specific Quarkus HTTP Configuration
14+
15+
```bash
16+
# setup Azure compatible root path
17+
export QUARKUS_HTTP_ROOT_PATH=/api/epcis-event-generator
18+
```
19+
20+
RECOMMENDED: use docker native build
21+
22+
```bash
23+
# run maven build via docker build (docker or podman required!)
24+
mvn -DskipTests=true -Pci-build package -Dnative \
25+
-Dquarkus.native.container-build=true \
26+
-f ../quarkus/quarkus-app/pom.xml
27+
```
28+
29+
OR: use local GraalVM (>=21.0.2) and Linux OS required
30+
31+
```bash
32+
# check java vm
33+
java --version
34+
#> openjdk 21.0.2 2024-01-16
35+
#> OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
36+
#> OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)
37+
38+
39+
# run maven build via local GraalVM (Linux OS required!)
40+
mvn -DskipTests=true -Pci-build package -Dnative \
41+
-f ../quarkus/quarkus-app/pom.xml
42+
```
43+
44+
FINALLY: copy binary build to azure-function deployment application file
45+
46+
```bash
47+
48+
# copy binary from build to 'application'
49+
cp ../quarkus/quarkus-app/target/openepcis-event-hash-generator-service-runner application
50+
```
51+
52+
## Deployment
53+
54+
### Create Function App in Azure
55+
56+
To deploy you’ll need to create an Azure Group and Function Application.
57+
58+
```bash
59+
# login
60+
$ az login
61+
62+
# create an Azure Resource Group
63+
az group create -n rg-openepcis-functions \
64+
-l eastus
65+
66+
# create an Azure Storage Account (required for Azure Functions App)
67+
az storage account create -n sargopenepcisfunctions \
68+
-g rg-openepcis-functions \
69+
-l eastus
70+
71+
# create an Azure Functions App
72+
az functionapp create -n yourunique-epcis-event-hash-app-name \
73+
-g rg-openepcis-functions \
74+
--consumption-plan-location eastus\
75+
--os-type Linux \
76+
--runtime custom \
77+
--functions-version 4 \
78+
--storage-account sargopenepcisfunctions
79+
```
80+
81+
*Make sure that the os-type is Linux*
82+
83+
**Note that your Function Application name must be unique and may collide with others.**
84+
85+
86+
#### Deploy Function to Azure
87+
88+
Now you can deploy your application, make sure you are in the azure-function directory!
89+
90+
```bash
91+
func azure functionapp publish yourunique-epcis-event-hash-app-name
92+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"bindings": [
3+
{
4+
"authLevel": "Anonymous",
5+
"type": "httpTrigger",
6+
"direction": "in",
7+
"name": "req",
8+
"methods": [
9+
"get",
10+
"post"
11+
],
12+
"route": "{*path}"
13+
},
14+
{
15+
"type": "http",
16+
"direction": "out",
17+
"name": "res"
18+
}
19+
]
20+
}

azure-function/host.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "2.0",
3+
"logging": {
4+
"applicationInsights": {
5+
"samplingSettings": {
6+
"isEnabled": true,
7+
"excludedTypes": "Request"
8+
}
9+
}
10+
},
11+
"extensionBundle": {
12+
"id": "Microsoft.Azure.Functions.ExtensionBundle",
13+
"version": "[4.*, 5.0.0)"
14+
},
15+
"customHandler": {
16+
"enableForwardingHttpRequest": true,
17+
"description": {
18+
"defaultExecutablePath": "application",
19+
"workingDirectory": "",
20+
"arguments": [
21+
"-Dquarkus.http.port=${FUNCTIONS_CUSTOMHANDLER_PORT:9000}"
22+
]
23+
}
24+
}
25+
}

testdata-generator-quarkus-rest-app/.gitignore

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

testdata-generator-quarkus-rest-app/.mvn/jvm.config

Lines changed: 0 additions & 1 deletion
This file was deleted.

testdata-generator-quarkus-rest-app/LICENSE

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

0 commit comments

Comments
 (0)