GithubHelp home page GithubHelp logo

winnerlbm / aws-wps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aodn/aws-wps

0.0 0.0 0.0 144.55 MB

Components for an OGC Web Processing Service providing NetCDF aggregation and subsetting services on AWS

License: GNU General Public License v3.0

Shell 0.45% JavaScript 1.44% Perl 0.54% Java 91.66% FreeMarker 5.63% Dockerfile 0.28%

aws-wps's Introduction

AWS/WPS

Project to build components for an OGC Web Processing Service providing NetCDF aggregation services on AWS

Licensing

This project is licensed under the terms of the GNU GPLv3 license.

When deployed to AWS

Overview

Components built using this project

Request Handler

Lambda function that handles OGC WPS requests

  • GetCapabilites - describes services provided
  • DescribeProcess - describes supported aggregation processes
  • Execute - submits an aggregation request to AWS Batch

Aggregation worker

Docker image that performs the actual aggregation. Its whats run on the EC2 instance, the request handler will post a batch task, where aws will call this worker given the docker image that is found in elastic container registry.

It stored under javaduck:latest repo for nonproduction-admin

Job Status service

Lambda function that handles job status requests.

In this project

  • doc supporting documentation files
  • request-handler a maven sub-module to build the lambda deployment package for the request handler
  • aggregation-worker a maven sub-module to build the docker image for the aggregation worker.
  • job-status-service a maven sub-module to build the lambda deployment package for the job status service
  • lambda the output directory for lambda function build. These zip files need to push to the aws
  • integration-tests a maven project that can be used to integration test a deployed AWS/WPS instance at a location specified by the WPS_ENDPOINT environment variable, that means you need to run the stack deploy.
  • requests contains a demo request that can be submitted to a deployed AWS/WPS instance
  • wps-cloudformation-template.yaml a cloud formation template for creating AWS components of the AWS/WPS instance

Supported aggregation processes

Limitations

Only OGC WPS features required to support the Portal/MARVL have been implemented. The following mandatory features from the spec are not supported:

  • loading inputs from web accessible resources
  • synchronous processing
  • encoding outputs in response
  • raw data output

To Build

Requirements:

  • maven 3
  • java 11
  • docker
$ mvn clean package

To run integration tests

Create environment for testing in nonproduction env

First install the aws-wps package to your maven repo:

$ mvn clean install

wps-cloudformation-template.yml is used to create the followings:

  • AWS Batch: Module aggregation-worker contains the code to do the batch job. During the build, the maven will invoke docker-build.sh under scripts to create a docker image. You can find the image with the command "docker images" assume you have installed docker.
  • AWS Lambda: Module job-status-service and request-handler are two lambda functions created with this template. After running the maven build, the two module will create a zip package and place it in the lambda folder.

You need to run an instance of batch job and the two lambdas in order to run the integration-test.

NOTE: For testing you can use stack-dev-deploy.sh under aggregation-worker/scripts, which push docker image and lambda zips then you can run from cloud-deploy directory

$AWS_WPS_PROJECT/aggregation-worker/scripts/stack-dev-deploy.sh $AWS_WPS_PROJECT $TAG

where $TAG is a name you choose, this is used to avoid the default name "latest" which is use for production deployment.

Click the stack you just created and go to the Resources section, find the "WPSRestApi" and click the link. Then click the APIs on the top menu and find the ID of your API_ID.

WPS_ENDPOINT=https://$API_ID.execute-api.ap-southeast-2.amazonaws.com/LATEST/wps

Finally you can run the integration-testing as below

cd integration-testing
WPS_ENDPOINT='https://w4fnovhz73.execute-api.ap-southeast-2.amazonaws.com/LATEST/wps' mvn verify

How to check log on cloud

You can view the log in cloud:

Lambda

  1. Goto your stack instance, click on it and goto the Resources section
  2. Find RequestHandlerLambdaFunction for request handler lambda function or JobStatusLambdaFunction for another lambda function
  3. Click the link, go to the Monitor tab, then hit "View logs in CloudWatch"

Batch Instance

  1. In cloudwatch search /aws/batch/job

How to delete

aws cloudformation delete-stack --stack-name YOUR_STACK_NAME --region ap-southeast-2

To submit a request

A sample request and a script to submit it can be found in the requets directory. The submit script should be modified to submit the request the to the required service url.

Deployment Pipeline/Process

โš ๏ธ Two different build at the same time:

The github build (something new) will build the item and determine if the build can be merged. However, it cannot push image to aws

The Jenkins build is the existing work way.

Once the code merged to master, the Jenkin job will push the docker image to the aws, you need to access via profie "production-developer" and go the docker registry the image can be used to push to test env while stack.

The lambda zip is store under s3 s3://imos-artifacts/promoted/aws-wps/build

Then you need to run stack in order to install the wps in your target environment.

aws-wps's People

Contributors

aodn-ci avatar ccmoloney avatar jonescc avatar akashisama avatar bhasin85 avatar utas-raymondng avatar lwgordonimos avatar pmbohm avatar digorgonzola avatar craigrose avatar gsatimos avatar nspool avatar sachitrajbhandari avatar sqbaillie avatar vietnguyengit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.