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

feat: Upload .dsc descriptor. #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ on:
jobs:

build-ci:
name: Build Template
name: Build ADempiere Processors Service
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Java JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-package: 'jdk'
java-version: 11
architecture: x64

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
env:
GITHUB_DEPLOY_USER: "${{ github.actor }}"
GITHUB_DEPLOY_TOKEN: "${{ secrets.DEPLOY_TOKEN }}"
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.0.2
arguments: build
env:
GITHUB_DEPLOY_USER: ${{ github.actor }}
GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}
31 changes: 22 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ jobs:

# Build dist application adempiere-processors-service
build-app:
name: Build dist Template
name: Build ADempiere Processors Service
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Java JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-package: 'jdk'
java-version: 11
architecture: x64

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.0.2
arguments: createRelease
Expand All @@ -37,26 +37,32 @@ jobs:
GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}

- name: Upload descriptor file artifact
uses: actions/upload-artifact@v4
with:
name: adempiere-processors-service.dsc
path: build/descriptors/adempiere-processors-service.dsc

- name: Upload dist app zip artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: adempiere-processors-service.zip
path: build/release/adempiere-processors-service.zip

- name: Upload dist app zip.MD5 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: adempiere-processors-service.zip.MD5
path: build/release/adempiere-processors-service.zip.MD5

- name: Upload dist app tar artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: adempiere-processors-service.tar
path: build/release/adempiere-processors-service.tar

- name: Upload dist app tar.MD5 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: adempiere-processors-service.tar.MD5
path: build/release/adempiere-processors-service.tar.MD5
Expand All @@ -70,7 +76,14 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Upload Descriptor
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: adempiere-processors-service.dsc/adempiere-processors-service.dsc

- name: Upload zip
uses: skx/github-action-publish-binaries@master
Expand Down
92 changes: 60 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ plugins {
id 'application'
id 'visual-studio'
}

group 'com.nikhilm'

sourceCompatibility = 1.11

def grpcVersion = '1.62.2'
def protobufVersion = '3.25.3'
def baseVersion = '3.9.4'
def baseGroupId = 'io.github.adempiere'
def privateDependencyBaseVersion = "adempiere-3.9.4"
def descriptorFile = "adempiere-processors-service.dsc"

startScripts.enabled = false

ext {
Expand All @@ -29,49 +35,53 @@ jar {
}

repositories {
mavenLocal()
mavenCentral()
mavenLocal()
maven {
url = System.getenv("GITHUB_DEPLOY_REPOSITORY") ?: System.properties['deploy.repository'] ?: 'https://maven.pkg.github.com'
credentials {
username = System.getenv("GITHUB_DEPLOY_USER") ?: System.properties['deploy.user']
password = System.getenv("GITHUB_DEPLOY_TOKEN") ?: System.properties['deploy.token']
// Adempiere GitHub Organization
url = findProperty("deployRepository") ?: System.properties['deploy.repository'] ?: System.getenv("GITHUB_DEPLOY_REPOSITORY") ?: 'https://maven.pkg.github.com'
credentials {
// project property, system properrty, enviroment variable
username = findProperty("deployUsername") ?: System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER")
password = findProperty("deployToken") ?: System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN")
}
}
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.12.0"
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.34.1'
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
all().configureEach { task ->
// If true, will generate a descriptor_set.desc file under
// task.outputBaseDir. Default is false.
// See --descriptor_set_out in protoc documentation about what it is.
task.generateDescriptorSet = true
// If true, will generate a descriptor_set.desc file under
// task.outputBaseDir. Default is false.
// See --descriptor_set_out in protoc documentation about what it is.
task.generateDescriptorSet = true

// Allows to override the default for the descriptor set location
task.descriptorSetOptions.path =
"${projectDir}/build/descriptors/adempiere-processors-service-service.pb"
// Allows to override the default for the descriptor set location
task.descriptorSetOptions.path = "${projectDir}/build/descriptors/${descriptorFile}"
// task.descriptorSetOptions.path = "${projectDir}/build/descriptors/adempiere-processors-service.dsc"

// If true, the descriptor set will contain line number information
// and comments. Default is false.
task.descriptorSetOptions.includeSourceInfo = true
// If true, the descriptor set will contain line number information
// and comments. Default is false.
task.descriptorSetOptions.includeSourceInfo = true

// If true, the descriptor set will contain all transitive imports and
// is therefore self-contained. Default is false.
task.descriptorSetOptions.includeImports = true
}
}
// If true, the descriptor set will contain all transitive imports and
// is therefore self-contained. Default is false.
task.descriptorSetOptions.includeImports = true
}
}
}

sourceSets {
main {
java {
Expand All @@ -81,6 +91,22 @@ sourceSets {
}
}
}

// Copy proto descriptor another folder
allprojects {
task copyDescriptor(type: Copy) {
from "${projectDir}/build/descriptors/${descriptorFile}"
into "${projectDir}/docker-compose/envoy/definitions"
// rename { "${descriptorFile}" }
}

tasks.matching {
it.name.startsWith('compileJava')
}.each { task ->
task.finalizedBy copyDescriptor
}
}

task AdempiereProcessorServer(type: CreateStartScripts) {
mainClass = javaMainClass
applicationName = 'adempiere-processors-service-server'
Expand Down Expand Up @@ -114,23 +140,25 @@ dependencies {
'*.jar'
]
)
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-alts:${grpcVersion}"
implementation "io.netty:netty-handler:4.1.107.Final"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty:${grpcVersion}"
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation 'com.google.protobuf:protobuf-java:3.25.3'
implementation 'com.google.protobuf:protobuf-java-util:3.25.3'
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-alts:${grpcVersion}"
implementation "io.netty:netty-handler:4.1.107.Final"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty:${grpcVersion}"
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"

implementation "io.jsonwebtoken:jjwt-api:0.12.6"
implementation "io.jsonwebtoken:jjwt-impl:0.12.6"
implementation "io.jsonwebtoken:jjwt-jackson:0.12.6"
//implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
//implementation 'com.sun.xml.bind:jaxb-impl:3.0.0-M4'
//implementation 'com.sun.xml.bind:jaxb-core:3.0.0-M4'
//implementation 'javax.activation:activation:1.1.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.0'

// ADempiere Core
implementation "${baseGroupId}:base:${baseVersion}"
implementation "${baseGroupId}:adempiere-grpc-utils:1.4.8"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ POSTGRES_PORT="5432"
POSTGRES_VOLUME="adempiere-processor.volume_postgres"

# ADempiere gRPC Server
ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.2"
ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.4"
ADEMPIERE_PROCESSOR_HOST="adempiere-processor.processor"

# Networks
Expand All @@ -32,4 +32,4 @@ RUNDECK_IMAGE="rundeck/rundeck:4.12.0"
RUNDECK_HOST="adempiere-processor.rundeck"
RUNDECK_PORT=4440
RUNDECK_REALM_SETTING="./rundeck/realm.properties"
RUNDECK_USER_POLICIES="./rundeck/user.aclpolicy"
RUNDECK_USER_POLICIES="./rundeck/user.aclpolicy"
7 changes: 4 additions & 3 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- shared_network

adempiere.processor:
image: ${ADEMPIERE_PROCESSOR_IMAGE}
container_name: ${ADEMPIERE_PROCESSOR_HOST}
Expand Down Expand Up @@ -75,18 +75,19 @@ services:
container_name: ${ENVOY_NAME}
volumes:
- ./envoy/envoy.yaml:/etc/envoy/envoy.yaml:ro
- ./envoy/definitions/adempiere-processors-service-service.pb:/data/adempiere-processors-service-service.pb:ro
- ./envoy/definitions/adempiere-processors-service.dsc:/data/adempiere-processors-service.dsc:ro
depends_on:
- adempiere.processor
ports:
- ${ENVOY_PORT}:5555
networks:
- shared_network


networks:
shared_network:
name: ${ADEMPIERE_NETWORK}

volumes:
volume_postgres:
name: ${POSTGRES_VOLUME}
Expand Down
Binary file not shown.
20 changes: 13 additions & 7 deletions docker-compose/envoy/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
static_resources:
listeners:
- name: adempiere_grpc_server
- name: adempiere_processor_proxy
address:
socket_address: {
address: 0.0.0.0,
Expand All @@ -12,7 +12,12 @@ static_resources:
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: grpc_json
access_log:
- name: envoy.access_loggers.stdout
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
codec_type: AUTO
stream_idle_timeout: 900s
route_config:
name: local_route
virtual_hosts:
Expand All @@ -23,14 +28,14 @@ static_resources:
prefix: "/"
}
route: {
cluster: adempiere-grpc-server,
timeout: 60s
cluster: adempiere_processor_cluster,
timeout: 900s
}
http_filters:
- name: envoy.filters.http.grpc_json_transcoder
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
proto_descriptor: "/data/adempiere-processors-service-service.pb"
proto_descriptor: "/data/adempiere-processors-service.dsc"
services:
- processor.Processors
print_options:
Expand All @@ -39,12 +44,13 @@ static_resources:
always_print_enums_as_ints: false
preserve_proto_field_names: true
convert_grpc_status: true
ignore_unknown_query_parameters: true
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

clusters:
- name: adempiere-grpc-server
- name: adempiere_processor_cluster
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
dns_lookup_family: V4_ONLY
Expand All @@ -54,7 +60,7 @@ static_resources:
explicit_http_config:
http2_protocol_options: {}
load_assignment:
cluster_name: adempiere-grpc-server
cluster_name: adempiere_processor_cluster
endpoints:
- lb_endpoints:
- endpoint:
Expand All @@ -64,4 +70,4 @@ static_resources:
# If you're running an older version of Docker, please use "docker.for.mac.localhost" instead.
# Reference: https://docs.docker.com/docker-for-mac/release-notes/#docker-community-edition-18030-ce-mac59-2018-03-26
address: adempiere.processor # for local testing change for your ip
port_value: 50059
port_value: 50059
Loading