-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #529 from umccr/attributes/portal-run-id
filemanager: annotate portal run id
- Loading branch information
Showing
37 changed files
with
1,470 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { FMAnnotatorConfigurableProps } from '../../lib/workload/stateless/stacks/fmannotator/deploy/stack'; | ||
import { eventBusName, jwtSecretName, vpcProps } from '../constants'; | ||
|
||
export const getFmAnnotatorProps = (): FMAnnotatorConfigurableProps => { | ||
return { | ||
vpcProps, | ||
eventBusName, | ||
jwtSecretName, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
services: | ||
api: | ||
build: | ||
context: . | ||
args: | ||
# The build itself needs access to the database. | ||
- DATABASE_URL=${BUILD_DATABASE_URL:-postgresql://filemanager:[email protected]:4321/filemanager} # pragma: allowlist secret | ||
environment: | ||
# Container database address for running server inside a docker container. | ||
- DATABASE_URL=${DATABASE_URL:-postgresql://filemanager:filemanager@postgres:4321/filemanager} | ||
- RUST_LOG=debug | ||
- FILEMANAGER_API_CORS_ALLOW_ORIGINS=${FILEMANAGER_API_CORS_ALLOW_ORIGINS:-http://localhost:3000} | ||
- FILEMANAGER_API_CORS_ALLOW_HEADERS=${FILEMANAGER_API_CORS_ALLOW_HEADERS:-accept,authorization,content-type,user-agent,x-csrftoken,x-requested-with,x-amz-security-token,x-amz-date,content-disposition} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-access_key_id} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-secret_access_key} | ||
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-ap-southeast-2} | ||
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN:-session_token} | ||
ports: | ||
- '${API_PORT}:8000' | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,30 +3,9 @@ services: | |
build: database | ||
restart: always | ||
environment: | ||
- POSTGRES_DATABASE=filemanager | ||
- POSTGRES_DB=filemanager | ||
- POSTGRES_USER=filemanager | ||
- POSTGRES_PASSWORD=filemanager | ||
- PGPORT=4321 | ||
ports: | ||
- "${FILEMANAGER_DATABASE_HOST}:${FILEMANAGER_DATABASE_PORT}:4321" | ||
api: | ||
build: | ||
context: . | ||
args: | ||
# The build itself needs access to the database. | ||
DATABASE_URL: postgresql://filemanager:[email protected]:4321/filemanager # pragma: allowlist secret | ||
environment: | ||
# Container database address for running server inside a docker container. | ||
- DATABASE_URL=postgresql://filemanager:filemanager@postgres:4321/filemanager | ||
- RUST_LOG=debug | ||
- FILEMANAGER_API_CORS_ALLOW_ORIGINS=${FILEMANAGER_API_CORS_ALLOW_ORIGINS:-http://localhost:3000} | ||
- FILEMANAGER_API_CORS_ALLOW_HEADERS=${FILEMANAGER_API_CORS_ALLOW_HEADERS:-accept,authorization,content-type,user-agent,x-csrftoken,x-requested-with,x-amz-security-token,x-amz-date,content-disposition} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-access_key_id} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-secret_access_key} | ||
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-ap-southeast-2} | ||
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN:-session_token} | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- postgres | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Default target | ||
default: help | ||
|
||
install: build | ||
all: build | ||
|
||
## Build related commands | ||
build: | ||
@go build -o build | ||
test: | ||
@go test | ||
lint: | ||
@go fmt | ||
golangci-lint: | ||
@golangci-lint run | ||
check: lint golangci-lint | ||
|
||
## Clean | ||
clean: | ||
@go mod tidy | ||
|
||
## Help text | ||
help: | ||
@printf "The attribute annotator Makefile.\n\n" | ||
@printf "Usage: make <target>\n" | ||
|
||
# No targets are files, so they are all PHONY. | ||
.PHONY: * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# FMAnnotator | ||
|
||
The FMAnnotator service annotates records using the FileManager API. | ||
|
||
## Development | ||
|
||
This service is written in Go, which should be [installed][golang]. Please also install [golangci-lint] to run lints on | ||
the codebase. | ||
|
||
This project is organised using the Go Lambda function CDK, and contains Lambda function handlers under [`cmd`][cmd] | ||
|
||
Makefile is used to simplify development. Tests can be run by using: | ||
|
||
```sh | ||
make test | ||
``` | ||
|
||
Lints and checks can be run using: | ||
|
||
```sh | ||
make check | ||
``` | ||
|
||
To update the [go.mod][go-mod] and download any new go modules: | ||
|
||
```sh | ||
make clean | ||
``` | ||
|
||
## Project layout | ||
|
||
This service has the following structure: | ||
|
||
* [cmd]: The Lambda handler `main.go` functions. | ||
* [deploy]: CDK deployment code. | ||
* [fixtures]: Database fixtures and test data. | ||
* [internal]: Internal package containing common test code. | ||
* [schema]: Generated EventBridge code-bindings. | ||
|
||
Top-level `.go` files contain library related code which implements the functionality of the FMAnnotator. | ||
Tests are defined using the `_test.go` suffix. | ||
|
||
[golang]: https://go.dev/doc/install | ||
[golangci-lint]: https://golangci-lint.run/welcome/install/#local-installation | ||
[cmd]: cmd | ||
[api]: api.go | ||
[config]: config.go | ||
[handlers]: handlers.go | ||
[internal]: internal | ||
[fixtures]: fixtures | ||
[schema]: schema | ||
[go-mod]: go.mod |
Oops, something went wrong.