Commit 528b5148 authored by dgasull's avatar dgasull

Added model and dataclay docker definition

parent 2d797675
/.project
# ELASTIC dataClay
This repository contains docker service definition to deploy dataClay and ELASTIC model to be registered
in dataClay.
You can find dataClay demos at:
https://github.com/bsc-dom/dataclay-demos
## Questions?
If you have any questions, please feel free to ask to support-dataclay@bsc.es
![dataClay logo](https://www.bsc.es/sites/default/files/public/styles/bscw2_-_simple_crop_style/public/bscw2/content/software-app/logo/logo_dataclay_web_bsc.jpg)
version: '3.4'
services:
logicmodule:
image: "bscdataclay/logicmodule:2.0"
command: "--debug"
ports:
- "11034:11034"
environment:
- LOGICMODULE_PORT_TCP=11034
- LOGICMODULE_HOST=logicmodule
- DATACLAY_ADMIN_USER=admin
- DATACLAY_ADMIN_PASSWORD=admin
volumes:
- ./prop/global.properties:/dataclay/cfgfiles/global.properties:ro
- ./prop/log4j2.xml:/dataclay/logging/log4j2.xml:ro
healthcheck:
interval: 5s
retries: 10
test: ["CMD-SHELL", "/dataclay/health/health_check.sh"]
dsjava:
image: "bscdataclay/dsjava:2.0"
command: "--debug"
ports:
- "2127:2127"
depends_on:
- logicmodule
environment:
- DATASERVICE_NAME=DS1
- DATASERVICE_JAVA_PORT_TCP=2127
- LOGICMODULE_PORT_TCP=11034
- LOGICMODULE_HOST=logicmodule
volumes:
- ./prop/global.properties:/dataclay/cfgfiles/global.properties:ro
- ./prop/log4j2.xml:/dataclay/logging/log4j2.xml:ro
healthcheck:
interval: 5s
retries: 10
test: ["CMD-SHELL", "/dataclay/health/health_check.sh"]
\ No newline at end of file
CHECK_LOG4J_ENABLED=false
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="60" status="off">
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_ERR">
<PatternLayout pattern="%d{ISO8601} %p [%c] [%t] [%C{1}:%L] %m%n"></PatternLayout>
</Console>
</Appenders>
<Loggers>
<!-- Runtime -->
<Logger name="ClientRuntime" level="off" />
<Logger name="ClientManagementLib" level="off"/>
<Logger name="DataClayRuntime" level="off"/>
<Logger name="DataServiceRuntime" level="off"/>
<Logger name="DataClayObjectLoader" level="off"/>
<Logger name="DataClayObject" level="off" /> <!-- This is very verbose! -->
<!-- Data service -->
<Logger name="DataService" level="off"/>
<Logger name="DataService.srv" level="off"/>
<Logger name="ExecutionEnvironmentSrv" level="off"/>
<!-- Lockers -->
<Logger name="dataclay.util.classloaders.SyncClass" level="off"/>
<Logger name="dataclay.heap.LockerPool" level="off"/>
<Logger name="LockerPool" level="off"/>
<Logger name="dataclay.util.classloaders.ClassLockers" level="off"/>
<!-- Garbage collection -->
<Logger name="GlobalGC" level="off"/>
<Logger name="heap.HeapManager" level="off"/>
<Logger name="ReferenceCounting" level="off"/>
<Logger name="StorageLocation" level="off"/>
<!-- Logic module -->
<Logger name="LogicModule" level="off"/>
<Logger name="LogicModule.srv" level="off"/>
<Logger name="LMDB" level="off"/>
<Logger name="managers" level="off" />
<Logger name="MetaDataService.db" level="off" />
<Logger name="MetaDataService" level="off" />
<!-- Communication -->
<Logger name="io.grpc" level="off"/>
<Logger name="io.netty" level="off"/>
<Logger name="NettyClientHandler" level="off"/>
<Logger name="grpc.client" level="off"/>
<Logger name="grpc.client.logicmodule" level="off"/>
<Logger name="communication.LogicModule.service" level="off"/>
<!-- Databases -->
<Logger name="dataclay.dbhandler" level="off"/>
<Logger name="dbhandler.PostgresConnection" level="off" />
<Logger name="org.apache.commons.dbcp2" level="off"/>
<Logger name="PostgresHandler" level="off"/>
<Logger name="SQLHandler" level="off"/>
<!-- Misc -->
<Logger name="util" level="off" />
<Logger name="exceptions" level="off"/>
<Logger name="Paraver" level="info"/>
<Logger name="DataClaySerializationLib" level="off"/>
<Logger name="DataClayDeserializationLib" level="off"/>
<!-- ROOT LOGGER -->
<Root level="off">
<AppenderRef ref="ConsoleAppender" />
</Root>
</Loggers>
</Configuration>
target
/bin/
/.classpath
/.project
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>es.bsc.dataclay</groupId>
<artifactId>nfrtool-dataclay-model</artifactId>
<version>2.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.release>8</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>es.bsc.dataclay</groupId>
<artifactId>dataclay</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>
package model;
import java.util.ArrayList;
/** This class simulates an ELASTIC application using COMPSs. Objects instantiated by this class can be
* distributed and synchronized among nodes. */
public class Application {
/** Application name. */
private String name;
/** Application master process. */
private Master master;
/** Application workers. */
private ArrayList<Worker> workers = new ArrayList<>();
/**
* Application constructor.
* @param appName Name of the application
*/
public Application(final String appName) {
this.name = appName;
}
/**
* Set application master.
* @param themaster Application's master node
*/
public void setMaster(final Master themaster) {
this.master = themaster;
}
/**
* Add a new woker to the application.
* @param worker Worker to be added
*/
public void addWorker(final Worker worker) {
workers.add(worker);
}
/**
* Get application master.
* @return Application master
*/
public Master getMaster() {
return this.master;
}
/**
* Get application workers.
* @return Application workers
*/
public ArrayList<Worker> getWorkers() {
return this.workers;
}
/**
* Get application name
* @return name
*/
public String getName() {
return this.name;
}
@Override
public String toString() {
String result = "Application: " + name + " \n";
result += " - master: " + master + "\n";
result += " - workers: " + workers + "\n";
return result;
}
}
package model;
import es.bsc.dataclay.DataClayObject;
/**
* This class represents a master process.
*/
public class Master extends DataClayObject {
/** Node containing the process. */
private Node node;
/** Master process PID. */
private int pid;
/**
* Constructor.
* @param node Node containing the process.
* @param pid Master process PID
*/
public Master(final Node node, final int pid) {
this.node = node;
this.pid = pid;
}
/**
* Get node containing Master process
* @return node containing Master process
*/
public Node getNode() {
return node;
}
/**
* Set node containing Master process
* @param node node containing Master process to set
*/
public void setNode(Node node) {
this.node = node;
}
/**
* Get PID of Master process
* @return PID of Master process
*/
public int getPid() {
return pid;
}
/**
* Set PID of Master process
* @param pid PID of Master process
*/
public void setPid(int pid) {
this.pid = pid;
}
@Override
public String toString() {
return " master { pid = " + pid + " , node = " + node.toString() + "}";
}
}
package model;
import es.bsc.dataclay.DataClayObject;
/**
* This class represents a COMPSs node.
*/
public class Node extends DataClayObject {
/** Node name. */
private String name;
/** Node address. */
private String address;
/** Node capacity. */
private int capacity;
/**
* Constructor.
* @param name Node name
* @param nodeAddress Node address.
* @param nodeCapacity Node capacity.
*/
public Node(final String name, final String nodeAddress, final int nodeCapacity) {
this.name = name;
this.address = nodeAddress;
this.capacity = nodeCapacity;
}
/**
* Get the address of the node
* @return node address
*/
public String getAddress() {
return address;
}
/**
* Set node address
* @param address the address to set
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Get capacity of the node
* @return node capacity
*/
public int getCapacity() {
return capacity;
}
/**
* Set capacity of the node
* @param capacity node capacity to set
*/
public void setCapacity(int capacity) {
this.capacity = capacity;
}
/**
* Get node name.
* @return Node name.
*/
public String getName() {
return name;
}
/**
* Set node name.
* @param name Node name to set.
*/
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return " [ name = " + name + " , machine-address = " + address + " , capacity = " + capacity + " ]";
}
}
package model;
import es.bsc.dataclay.DataClayObject;
/**
* This class represents a worker process.
*/
public class Worker extends DataClayObject {
/** Node containing the process. */
private Node node;
/** Worker process address. */
private String address;
/** Worker process PID. */
private int pid;
/**
* Constructor.
* @param node Node containing the process.
* @param address Worker process address.
* @param pid Worker process PID
*/
public Worker(final Node node, final String address, final int pid) {
this.node = node;
this.address = address;
this.pid = pid;
}
/**
* Get the address of the worker
* @return worker address
*/
public String getAddress() {
return address;
}
/**
* Set worker address
* @param address the worker address to set
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Get node containing worker process
* @return node containing worker process
*/
public Node getNode() {
return node;
}
/**
* Set node containing worker process
* @param node node containing worker process to set
*/
public void setNode(Node node) {
this.node = node;
}
/**
* Get PID of worker process
* @return PID of worker process
*/
public int getPid() {
return pid;
}
/**
* Set PID of worker process
* @param pid PID of worker process
*/
public void setPid(int pid) {
this.pid = pid;
}
@Override
public String toString() {
return " worker { pid = " + pid + " , address = " + address + ", node = " + node.toString() + "}";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment