Skip to content

Commit

Permalink
Fix parent docker-compose (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrimaz authored Jul 6, 2023
1 parent d4d8cb1 commit 2dcb812
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ spring.application.name=AAS Environment

basyx.backend = InMemory

#basyx.backend = MongoDB
#spring.data.mongodb.host=mongo
# or spring.data.mongodb.host=127.0.0.1
#spring.data.mongodb.port=27017
#spring.data.mongodb.database=aasenvironments
#spring.data.mongodb.authentication-database=admin
#spring.data.mongodb.username=mongoAdmin
#spring.data.mongodb.password=mongoPassword


# basyx.aasrepository.feature.mqtt.enabled = true
# mqtt.clientId=TestClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class TestMongoDBAasRepository extends AasRepositorySuite {

@Override
protected AasRepositoryFactory getAasRepositoryFactory() {
String connectionURL = "mongodb://127.0.0.1:27017/";
String connectionURL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/";
MongoClient client = MongoClients.create(connectionURL);
MongoTemplate template = new MongoTemplate(client, "BaSyxTestDb");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ spring.application.name=AAS Repository

basyx.backend = InMemory

# basyx.backend = MongoDB
#spring.data.mongodb.host=localhost
#basyx.backend = MongoDB
#spring.data.mongodb.host=127.0.0.1
#spring.data.mongodb.port=27017
#spring.data.mongodb.database=aas
#spring.data.mongodb.username=admin
#spring.data.mongodb.password=password
#spring.data.mongodb.authentication-database=admin
#spring.data.mongodb.username=mongoAdmin
#spring.data.mongodb.password=mongoPassword


# basyx.aasrepository.feature.mqtt.enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private ConceptDescription createDummyConceptDescriptionOnRepo(ConceptDescriptio
}

private MongoTemplate createTemplate() {
String connectionURL = "mongodb://127.0.0.1:27017/";
String connectionURL = "mongodb://mongoAdmin:mongoPassword@localhost:27017/";
MongoClient client = MongoClients.create(connectionURL);
MongoTemplate template = new MongoTemplate(client, "BaSyxTestDb");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
server.port=8081

spring.application.name=Concept Description Repository

basyx.backend = InMemory

# basyx.backend = MongoDB
#spring.data.mongodb.host=localhost
#basyx.backend = MongoDB
#spring.data.mongodb.host=127.0.0.1
##or spring.data.mongodb.host=127.0.0.1
#spring.data.mongodb.port=27017
#spring.data.mongodb.database=aas
#spring.data.mongodb.username=admin
#spring.data.mongodb.password=password
#spring.data.mongodb.database=concepts
#spring.data.mongodb.authentication-database=admin
#spring.data.mongodb.username=mongoAdmin
#spring.data.mongodb.password=mongoPassword

#alternative
#spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@localhost:27017/?authMechanism=DEFAULT

# Base Path for Spring Boot Actuator
management.endpoints.web.base-path=/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

public class TestMongoDBSubmodelRepository extends SubmodelRepositorySuite {
private final String COLLECTION = "submodelTestCollection";
private final String CONNECTION_URL = "mongodb://127.0.0.1:27017/";
private final String CONNECTION_URL = "mongodb://mongoAdmin:mongoPassword@localhost:27017";
private final MongoClient CLIENT = MongoClients.create(CONNECTION_URL);
private final MongoTemplate TEMPLATE = new MongoTemplate(CLIENT, "BaSyxTestDb");
private final InMemorySubmodelServiceFactory SUBMODEL_SERVICE_FACTORY = new InMemorySubmodelServiceFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ server.port=8081
spring.application.name=Submodel Repository
basyx.backend = InMemory

# basyx.backend = MongoDB
#spring.data.mongodb.host=localhost
#basyx.backend = MongoDB
#spring.data.mongodb.host=mongo
# or spring.data.mongodb.host=127.0.0.1
#spring.data.mongodb.port=27017
#spring.data.mongodb.database=aas
#spring.data.mongodb.username=admin
#spring.data.mongodb.password=password
#spring.data.mongodb.database=submodels
#spring.data.mongodb.authentication-database=admin
#spring.data.mongodb.username=mongoAdmin
#spring.data.mongodb.password=mongoPassword

# basyx.submodelrepository.feature.mqtt.enabled = true
# mqtt.clientId=TestClient
Expand Down
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ services:
mongo:
image: mongo:5.0.10
# Provide mongo config
restart: always
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
ME_CONFIG_MONGODB_ADMINPASSWORD: admin
ME_CONFIG_MONGODB_URL: mongodb://admin:admin@mongo:27017/
MONGO_INITDB_ROOT_USERNAME: mongoAdmin
MONGO_INITDB_ROOT_PASSWORD: mongoPassword
# Set health checks to wait until mongo has started
healthcheck:
test: mongo
Expand All @@ -19,7 +19,6 @@ services:
networks:
- basyx-java-server-sdk


networks:
basyx-java-server-sdk:
name: basyx-java-server-sdk
Expand Down
2 changes: 1 addition & 1 deletion examples/aas-env.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server.port=8081
basyx.backend = MongoDB

spring.data.mongodb.uri=mongodb://mongo:27017/aas
spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@mongo:27017/?authMechanism=DEFAULT

#basyx.aasrepository.feature.mqtt.enabled = true
mqtt.clientId=AAS-Env-Example-8081
Expand Down
2 changes: 1 addition & 1 deletion examples/aas-repo.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server.port=8082
basyx.backend = MongoDB

spring.data.mongodb.uri=mongodb://mongo:27017/aas
spring.data.mongodb.uri=mongodb://mongoAdmin:mongoPassword@localhost:27017/?authMechanism=DEFAULT

#basyx.aasrepository.feature.mqtt.enabled = true
mqtt.clientId=AAS-Repo-Example-8082
Expand Down
16 changes: 16 additions & 0 deletions examples/cd-repo.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server.port=8081

spring.application.name=Concept Description Repository



basyx.backend = MongoDB
spring.data.mongodb.host=mongo
spring.data.mongodb.port=27017
spring.data.mongodb.database=concepts
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=mongoAdmin
spring.data.mongodb.password=mongoPassword

# Base Path for Spring Boot Actuator
management.endpoints.web.base-path=/
20 changes: 20 additions & 0 deletions examples/docker-compose-cd-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.9"
services:
cd-repo:
# get the image from dockerhub
image: eclipsebasyx/conceptdescription-repository:2.0.0-SNAPSHOT
# if you already build it locally, you can use your local image
# image: basyx.conceptdescriptionrepository.component:latest
# for manual local build `mvn clean install -DskipTests`
# then navigate to `basyx.conceptdescriptionrepository>component`
# build it with `docker build -t basyx.conceptdescriptionrepository.component .
volumes:
- ./cd-repo.properties:/application/application.properties
ports:
- 8081:8081
networks:
- basyx-java-server-sdk

networks:
basyx-java-server-sdk:
external: true
2 changes: 1 addition & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
##############################################################################
##############################################################################
###
### Do forget to start docker-compose in basyx.parent to get a running mongodb
### Do not forget to start docker-compose in basyx.parent to get a running mongodb
###
##############################################################################
##############################################################################
Expand Down

0 comments on commit 2dcb812

Please sign in to comment.