Sign inSign up

olafdavid/csip_dev

By olafdavid

Updated over 10 years ago

CSIP service development template image

Image
1

1.0K

olafdavid/csip_dev repository overview

CSIP DEV

Usage

This docker image lets you create a deployable CSIP service from Java sources. All required tools for CSIP development are bundled in this image. You need to mount a workspace containing your service sources when running the container, the default container command will compile the sources and create package in the same workspace. No other setup is needed, quite simple.

Create a workspace
mkdir -p $HOME/work/java

Create a workspace in your home folder to store the sources in java

Create a package folder
mkdir -p $HOME/work/java/m/conv

We need a package, too.

Create a service
cat > $HOME/work/java/m/conv/V1_0.java << EOL      
package m.conv;
 import javax.ws.rs.Path;
 import oms3.annotations.*;
 import csip.annotations.*;

 @Name("Temperature conversion.")
 @Path("m/conv/1.0")
 @Resource(type = ResourceType.OMS_COMP)
 public class V1_0 extends csip.ModelDataService {

     @Description("Temperature in C")
     @Unit("C")
     @In public double temp_c = 45.2;

     @Description("Temperature in F")
     @Unit("F")
     @Out public double temp_f;
     
     @Execute public void run() {
         temp_f = temp_c * 9 / 5 + 32;
     }
 }EOL

This is a simple temperature conversion service, expecting a value in Celsius and converting it to Fahrenheit.

Build the CSIP services using the docker image.
sudo docker run --rm -it -v $HOME/work:/work olafdavid/csip_dev

This will download the image, then create and run a container with the mounted work folder, compiles the sources found in $HOME/java, and finally builds the war file in $HOME/work/dist.

ls $HOME/work/dist 
csip.war

For further information about deploying and running a service, check out the "Getting Started" section at

https://alm.engr.colostate.edu/cb/project/csip ....

Tag summary

Content type

Image

Digest

Size

253.5 MB

Last updated

over 10 years ago

docker pull olafdavid/csip_dev