Skip to content

Commit

Permalink
containerize
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabattaglia committed Sep 15, 2021
1 parent 7390681 commit d3b044b
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 29 deletions.
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

echo "Edge - Machinery Service"
./mvnw clean package -U -Pnative -Dquarkus.native.container-build=true
docker rmi quay.io/qiotmanufacturing/edge-machinery:1.0.0-alpha7 --force
docker build -f src/main/docker/Dockerfile.native -t quay.io/qiotmanufacturing/edge-machinery:1.0.0-alpha7 .
docker push quay.io/qiotmanufacturing/edge-machinery:1.0.0-alpha7
Binary file added certs/client.ks
Binary file not shown.
Binary file added certs/client.ts
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public class MachineryServiceImpl implements MachineryService {
@ConfigProperty(name = "qiot.machinery.name")
String MACHINERY_NAME;

@ConfigProperty(name = "qiot.mqtts.ks.password")
@ConfigProperty(name = "qiot.runtime.ks.password")
String ksPassword;
@ConfigProperty(name = "qiot.mqtts.ts.password")
@ConfigProperty(name = "qiot.runtime.ts.password")
String tsPassword;

private Path dataFilePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

import io.qiot.manufacturing.all.commons.domain.cdi.BootstrapCompletedEventDTO;
import io.qiot.manufacturing.all.commons.domain.productline.ProductLineDTO;
import io.qiot.manufacturing.commons.util.producer.ProductLineReplyToQueueNameProducer;
import io.qiot.manufacturing.edge.machinery.domain.event.productline.ProductLineChangedEventDTO;
import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService;
import io.qiot.manufacturing.factory.commons.util.producer.ProductLineReplyToQueueNameProducer;

/**
* @author andreabattaglia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class RegistrationServiceImpl implements RegistrationService {
@Inject
Logger LOGGER;

@ConfigProperty(name = "qiot.mqtts.ks.path")
@ConfigProperty(name = "qiot.runtime.ks.path")
String ksPathString;
@ConfigProperty(name = "qiot.mqtts.ts.path")
@ConfigProperty(name = "qiot.runtime.ts.path")
String tsPathString;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import io.qiot.manufacturing.all.commons.domain.cdi.BootstrapCompletedEventDTO;
import io.qiot.manufacturing.commons.domain.productionvalidation.ValidationResponseDTO;
import io.qiot.manufacturing.commons.util.producer.ValidationReplyToQueueNameProducer;
import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationFailedEvent;
import io.qiot.manufacturing.edge.machinery.domain.event.chain.ValidationSuccessfullEvent;
import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService;
import io.qiot.manufacturing.factory.commons.util.producer.ValidationReplyToQueueNameProducer;

/**
* @author andreabattaglia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import io.qiot.manufacturing.all.commons.domain.production.ProductionChainStageEnum;
import io.qiot.manufacturing.commons.domain.productionvalidation.AbstractValidationRequestEventDTO;
import io.qiot.manufacturing.commons.util.producer.ValidationReplyToQueueNameProducer;
import io.qiot.manufacturing.edge.machinery.service.machinery.MachineryService;
import io.qiot.manufacturing.factory.commons.util.producer.ValidationReplyToQueueNameProducer;

/**
* @author andreabattaglia
Expand Down
53 changes: 31 additions & 22 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ quarkus.log.level=${LOG_LEVEL\:INFO}
%dev.quarkus.http.port=5001
quarkus.resteasy.path=/v1

quarkus.ssl.native=true
quarkus.native.enable-all-security-services=true
#quarkus.ssl.native=true
#quarkus.native.enable-all-security-services=true


########## OPENAPI ##########
Expand All @@ -20,8 +20,9 @@ quarkus.swagger-ui.always-include=true


########## APP data ##########
%dev.qiot.data.reset=${DO_RESET:true}
qiot.data.reset=false
qiot.data.reset=${DO_RESET:false}

quarkus.native.resources.includes=certs/**

qiot.folder.root=/var/data/qiot/machinery
qiot.folder.data.relative=data
Expand All @@ -31,41 +32,49 @@ qiot.datafile.path.relative=machinerydata.json
qiot.datafile.path=${qiot.folder.data}/${qiot.datafile.path.relative}

#Keystore
qiot.mqtts.ks.path=${qiot.folder.data}/mqtts/client.ks
qiot.mqtts.ks.password=${KEYSTOREPASSWORD\:123456}
qiot.runtime.ks.path=${qiot.folder.data}/runtime/client.ks
qiot.runtime.ks.password=${KEYSTORE_PASSWORD\:123456}

#Truststore
qiot.mqtts.ts.path=${qiot.folder.data}/mqtts/client.ts
qiot.mqtts.ts.password=${TRUSTSTOREPASSWORD\:123456}
qiot.runtime.ts.path=${qiot.folder.data}/runtime/client.ts
qiot.runtime.ts.password=${TRUSTSTORE_PASSWORD\:123456}

%dev.qiot.machinery.serial=testmachineryserial01
%dev.qiot.machinery.name=testmachineryname01


########## REST CLIENT - PRODUCT LINE ##########
#factoryproductline-api/mp-rest/url=${FACTORY-PRODUCTLINE-SERVICE-URL:http://localhost:5101}
#factoryproductline-api/mp-rest/scope=javax.inject.Singleton
qiot.machinery.serial=${MACHINERY_SERIAL}
qiot.machinery.name=${MACHINERY_NAME}


########## REST CLIENT - FACILITY MANAGER ##########
facility-manager-api/mp-rest/url=${FACILITY_MANAGER_SERVICE-URL:http://localhost:5100}
facility-manager-api/mp-rest/url=${FACILITY_MANAGER_SERVICE_URL:http://localhost:5100}
facility-manager-api/mp-rest/scope=javax.inject.Singleton

%dev.facility-manager-api/mp-rest/hostnameVerifier=io.quarkus.restclient.NoopHostnameVerifier
%staging.facility-manager-api/mp-rest/hostnameVerifier=io.quarkus.restclient.NoopHostnameVerifier

#facility-manager-api/mp-rest/url=${REGISTRATION-SERVICE-URL\:https\://localhost:8443}
#facility-manager-api/mp-rest/keyStore=${qiot.folder.root}/https/client.ks
#facility-manager-api/mp-rest/keyStorePassword=123456
#facility-manager-api/mp-rest/trustStore=${qiot.folder.root}/https/client.ts
#facility-manager-api/mp-rest/trustStorePassword=123456
#facility-manager-api/mp-rest/scope=javax.inject.Singleton
facility-manager-api/mp-rest/keyStore=classpath:/certs/bootstrap/machineryfactory/client.ks
facility-manager-api/mp-rest/keyStorePassword=123456
facility-manager-api/mp-rest/trustStore=classpath:/certs/bootstrap/machineryfactory/client.ts
facility-manager-api/mp-rest/trustStorePassword=123456


########## MESSAGING ##########
########## REST CLIENT - PRODUCT LINE ##########
#factoryproductline-api/mp-rest/url=${FACTORY_PRODUCTLINE_SERVICE_URL:http://localhost:5101}
#factoryproductline-api/mp-rest/scope=javax.inject.Singleton

### SERVER
quarkus.artemis.url=tcp://localhost:61616
%dev.facility-manager-api/mp-rest/hostnameVerifier=io.quarkus.restclient.NoopHostnameVerifier
%staging.facility-manager-api/mp-rest/hostnameVerifier=io.quarkus.restclient.NoopHostnameVerifier

# TODO: find workaround for Certificate file: /var/data/qiot/machinery/data/runtime/client.ts not found for MicroProfile Rest Client SSL configuration
#facility-manager-api/mp-rest/keyStore=${qiot.runtime.ks.path}
#facility-manager-api/mp-rest/keyStorePassword=${qiot.runtime.ks.password}
#facility-manager-api/mp-rest/trustStore=${qiot.runtime.ts.path}
#facility-manager-api/mp-rest/trustStorePassword=${qiot.runtime.ts.password}


########## MESSAGING ##########
quarkus.artemis.url=tcp://${BROKER_URL:localhost:61616}
quarkus.artemis.username=qiotmanufacturing
quarkus.artemis.password=qiotmanufacturingpassword

Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit d3b044b

Please sign in to comment.