Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Sample workflow for building and deploying a website to GitHub Pages
name: Deploy Pages

on:
# Runs on pushes targeting the default branch and c4 files
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_call:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
#permissions:
# contents: read
# pages: write
# id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in progress and the latest queued.
# However, do NOT cancel in-progress runs, as we want to allow these production deployments to be completed.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Validate model following our rules
# @see test/validate-model.spec.ts
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

#- name: Validate
# run: bun run test

# Build job
build-pages:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

- name: Build
run: |
bunx likec4@latest build \
--base "${{ steps.pages.outputs.base_path || '/docs' }}" \
--output dist

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

# Deployment job
#deploy-pages:
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# needs: build-pages
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@ cython_debug/
/cache-directory/
data
.vscode
node_modules
18 changes: 18 additions & 0 deletions docs/c4_diagrams/likec4_src/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

## Build commands

`npx likec4 codegen react --no-use-dot -o ../likec4_react/likec4.generated.js`

Note that `--no-use-dot` is needed for general containers which aren't the likec4 dedicated container.


## Index image generation

This uses a headless browser session, so the dependencies for playwright have to be installed first
`npx playwright install`
`npx playwright install-deps`

Then run the export command
`npx likec4 export png --no-use-dot`
Copy the index figure into the public images directory
`cp index.png ../public/images/likec4_index.png`
45 changes: 45 additions & 0 deletions docs/c4_diagrams/likec4_src/context.c4
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
model {
// ---------------------------------------------------------------------------
// Actors

researcher = external_actor {
title 'Researcher'
description 'Researcher who wishes to perform analyses on protected data'

-> ro-crate_service.ro-crate_service 'Submits tasks via'
-> tre.tre_app 'Submits tasks via'
}

// ----------------------------------------------------------------------------
// Systems

ro-crate_validator = system {
title 'RO-Crate Validator'
description 'System for validating RO-Crates'
technology '[Docker Compose stack]'
}

tre = system {
title 'TRE Stack'
description 'TRE stack'
}

// ----------------------------------------------------------------------------
// External Systems

ro-crate_service = system {
title 'RO-Crate Service'
description 'Service for submitting RO-Crate packaged work'
technology '[Python package]'
}

}

views {
view index {
title 'RO-Crate Validation Service - Context'
description 'Top level diagram'
include *
exclude ro-crate_service
}
}
Binary file added docs/c4_diagrams/likec4_src/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/c4_diagrams/likec4_src/ro-crate_service/ro-crate_service.c4
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
model {
extend ro-crate_service {
ro-crate_service = service {
title 'RO-Crate Service'
description 'Service for submitting work via RO-Crates'

-> tre 'Submits tasks via'
-> ro-crate_validator.validator_api 'Validates RO-Crates via'
}
}
}

views {
view ro-crate_service of ro-crate_service {
title 'RO-Crate Service'
include *
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
model {
extend ro-crate_validator {
validator_api = service {
title 'RO-Crate Validator API'
description 'API for validating RO-Crates'

-> redis 'Submits validation tasks to'
}

celery_worker = component {
title 'Celery Worker'
description 'Processes validation tasks'
icon https://github.com/celery/celery/blob/main/docs/images/celery_128.png?raw=true

-> redis 'Receives validation tasks from'
-> tre.minio 'Fetches RO-Crate data from'
-> tre.minio 'Stores validation results in'
-> validator_api 'Sends validation results to'
}

redis = component {
title 'Redis'
description 'In-memory data structure store'
icon tech:redis
}
}
}

views {
view ro-crate_validator of ro-crate_validator {
title 'RO-Crate Validator Service'
include *
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs/c4_diagrams/likec4_src/specs.c4
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
specification {
element external_actor {
style {
shape person
color red
}
}
element internal_actor {
style {
shape person
color green
}
}

color orange rgba(255, 153, 0, 100%)
element database {
style {
shape storage
color orange
multiple true
}
}

color system-colour rgba(35, 67, 99, 100%)
element system {
style {
color system-colour
}
}

color service-colour rgba(0, 100, 150, 100%)
element service {
style {
color service-colour
}
}

color component-colour rgba(0, 0, 0, 100%)
element component {
style {
color component-colour
}
}

deploymentNode environment

deploymentNode vm {
notation 'Virtual Machine'
}
}
32 changes: 32 additions & 0 deletions docs/c4_diagrams/likec4_src/tre/tre.c4
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
model {
extend tre {
tre_app = service {
title 'TRE Application'
description 'Application managing tasks in the TRE'

-> tre_keycloak 'Authenticates requests via'
-> minio 'Stores and retrieves data from'
-> ro-crate_validator.validator_api 'Sends validation tasks to'
-> ro-crate_validator.validator_api 'Receives validation results from'
}

tre_keycloak = component {
title 'TRE Keycloak'
description 'Authenticates requests throughout the layer'
icon https://upload.wikimedia.org/wikipedia/commons/2/29/Keycloak_Logo.png
}

minio = component {
title 'Minio'
description 'S3 Object Store'
icon https://dl.min.io/logo/Minio_logo_light/Minio_logo_light.png
}
}
}

views {
view tre of tre {
title 'TRE Service'
include *
}
}
Binary file added docs/c4_diagrams/likec4_src/tre/tre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Installation & Setup

```likec4-view
ro-crate_service
```

## Service Snapshot
The RO-Crate Validation Service works in two ways: a metadata-only mode, in which the contents of an `ro-crate-metadata.json` file are assessed, and storage-backed validation, where complete RO-Crates (zip or directory) are evaluated.

## Quick start
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ theme: readthedocs
plugins:
- search
- mermaid2
- likec4
markdown_extensions:
- admonition
Loading
Loading