Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.
/ microservice Public archive

A module that manages timers, handles HTTP requests, and executes OpenFn jobs (with adaptors, triggers, and credentials) using OpenFn/core.

License

GPL-3.0, LGPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
LGPL-3.0
LICENSE.LESSER
Notifications You must be signed in to change notification settings

OpenFn/microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4e11f02 · Feb 18, 2023
Sep 13, 2022
Sep 13, 2022
Sep 13, 2022
Apr 27, 2021
Mar 19, 2021
Apr 27, 2021
Sep 13, 2022
Nov 5, 2020
Apr 14, 2021
Nov 5, 2020
Apr 14, 2021
Nov 5, 2020
Apr 15, 2021
Feb 28, 2021
Sep 13, 2022
Feb 28, 2021
Sep 13, 2022
Dec 3, 2020
Dec 3, 2020
Mar 2, 2021
Mar 2, 2021
Feb 18, 2023
Apr 27, 2021
Apr 13, 2021
Sep 13, 2022
Sep 13, 2022
Mar 15, 2021

Repository files navigation

⚠️ Replaced by OpenFn/lightning

OpenFn/microservice (deprecated)

Supported by OpenFn, DIAL, UNICEF, and with UK aid from the British people.

🔥 The documentation for this project can be found at docs.openfn.org. 🔥

Docker build

`docker build -t openfn/microservice:<version> .`

Docker compose or run

Assuming you've got an .env and a project directory with a project.yaml spec:

docker-compose up
docker run -v <path-to-your-project-folder>:/home/microservice/<path-to-your-project-folder> \
  --env-file <path-to-your-env-file> \
  --network host \
  openfn/microservice:<version>

Instant OpenHIE

First ensure you have cloned this repository, then from the instant folder (the folder where you'd typically run your "Instant OpenHIE commands") run the following command:

yarn docker:instant init openfnMicroservice --custom-package="<path to this folder>"

Test the deployment by posting messages to port 4001.

Development up and running guide

Installing pre-requisites

  • It's recommended to use nvm to install NodeJs. At the time of writing, the platform-app instance on US servers and the dockerized microservice instance are running on NodeJs v12.20.2.
  • It's highly recommended to use asdf for managing your Erlang and Elixir versions. After installing asdf, install Erlang and Elixir.
  • asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
  • asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
  • At the time of writing, we're using Erlang/OTP 23 [erts-11.1.8] and Elixir 1.11.3 (compiled with Erlang/OTP 23)
  • Also at the time of writing, we're assuming that logs are ingested by a host service so we don't depend on a database!
  • Once NodeJs, Erlang and Elixir are installed, proceed to the application build/setup section below.

Application build/setup

  • Clone this repo with git clone git@github.com:OpenFn/microservice.git
  • Enter the directory with cd microservice
  • Install dependencies with mix setup
  • Run the tests with mix test
  • Make a project directory to hold your project artifacts with mkdir sample-project
  • Create a new project specification with cp project.yaml.example ./sample-project/project.yaml
  • Create a .env file with cp .env.example .env
  • Install necessary adaptors via npm install @openfn/language-http --prefix priv/openfn/runtime/node_modules --no-save --no-package-lock --global-style
  • Start your microservice server with env $(cat .env | grep -v "#" | xargs ) iex -S mix phx.server

About

A module that manages timers, handles HTTP requests, and executes OpenFn jobs (with adaptors, triggers, and credentials) using OpenFn/core.

Topics

Resources

License

GPL-3.0, LGPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
LGPL-3.0
LICENSE.LESSER

Stars

Watchers

Forks

Packages

No packages published