Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Viash 0.9 #27

Merged
merged 51 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8d01813
Update action.yml
rcannood Feb 24, 2024
1c6dab7
Update jq query
rcannood Feb 24, 2024
2220abf
update for viash 0.9
rcannood Jun 17, 2024
e67a9ed
add matrix to output of ns list
rcannood Jun 19, 2024
e3af58d
update docs
rcannood Jun 19, 2024
b5652af
fix description
rcannood Jun 21, 2024
181261e
add more actions
rcannood Jun 21, 2024
fa0303d
update action
rcannood Jun 21, 2024
d1628e9
update readme
rcannood Jun 21, 2024
dd78242
remove functionality
rcannood Jun 21, 2024
53e9549
remove variable
rcannood Jun 21, 2024
99cabaa
update action
rcannood Jun 21, 2024
ee043a8
update
rcannood Jun 21, 2024
40cf5e4
fix action
rcannood Jun 21, 2024
db639cf
fix action
rcannood Jun 21, 2024
2eb4933
fix ci
rcannood Jun 21, 2024
6481bac
pin versions
rcannood Jun 21, 2024
1526efa
fix action
rcannood Jun 21, 2024
e8a2ed2
fix ci
rcannood Jun 21, 2024
4f53681
fix ci
rcannood Jun 21, 2024
5682e29
fix ci
rcannood Jun 21, 2024
805d899
fix ci
rcannood Jun 21, 2024
7e5c61e
fix ci
rcannood Jun 21, 2024
bc1938c
fix ci
rcannood Jun 21, 2024
7a25727
fix ci
rcannood Jun 21, 2024
4b864eb
add matrix to output
rcannood Jun 21, 2024
51c0f63
fix ci
rcannood Jun 21, 2024
1b56dd5
fix action
rcannood Jun 21, 2024
f2c7a0d
fix action
rcannood Jun 21, 2024
1e23fe1
fix action
rcannood Jun 21, 2024
c1e986e
improve readability
rcannood Jun 21, 2024
067c323
fix action
rcannood Jun 21, 2024
746c4fc
clean up action
rcannood Jun 21, 2024
070141d
move update docker engine
rcannood Jun 27, 2024
c122353
remove viash hub deploy
rcannood Jun 27, 2024
e0714c9
arguments `components` and `workflows` were removed in favour for the…
rcannood Jun 27, 2024
d3ee4f2
uniformize documentation pages
rcannood Jun 27, 2024
e4ad37a
add changelog
rcannood Jun 27, 2024
d259c57
update docs
rcannood Jun 27, 2024
4e15063
update changelog
rcannood Jun 27, 2024
3be470f
update mentioned viash versions to v6
rcannood Jun 27, 2024
380b4e8
Merge remote-tracking branch 'origin/main' into viash-0.9
rcannood Jun 27, 2024
cf832fe
fix platform description
rcannood Jun 27, 2024
c405fc6
fix indentation
rcannood Jun 27, 2024
32af762
update readme
rcannood Jun 27, 2024
9b43ba2
simplify readme
rcannood Jun 27, 2024
d120674
fix check-concurrent-pr
rcannood Jun 27, 2024
4f2175c
fix fallback
rcannood Jun 27, 2024
8b95643
add paste
rcannood Jun 27, 2024
d43b0b2
fix flag
rcannood Jun 27, 2024
6654611
add entry to changelog
rcannood Jun 28, 2024
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
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# viash-actions v6.0.0
rcannood marked this conversation as resolved.
Show resolved Hide resolved

## Breaking changes

* `update-docker-engine` was moved to `project/update-docker-engine` (PR #27).

* `pro/build-nextflow-params` arguments `components` and `workflows` were removed in favour for the `target_dir` argument (PR #27).

* `pro/build-nextflow-schemas` arguments `components` and `workflows` were removed in favour for the `target_dir` argument (PR #27).

## New functionality

* `project/build-target`: Created an action for building a target directory using `viash ns build` and generating a matrix of the components for which Docker images need to be built and pushed (PR #27).

## Major changes

* All actions were updated to work with Viash 0.9 and later (PR #27).

## Documentation

* Updated all READMEs to be more consistent (PR #27).

* Added a Makefile for generating READMEs more efficiently (PR #27).


# viash-actions v5.3.1

## Bug fixes
Expand All @@ -20,13 +45,13 @@

## Minor changes

* `project/detect-changed-components`: bump `tj-actions/changed-files` to `42.0.2` (PR #24)
* `project/detect-changed-components`: bump `tj-actions/changed-files` to `42.0.2` (PR #24).

# viash-actions v5.1.0

## New functionality

* `pro/build-nextflow-schemas`: Add optional flag to allow dataset input for nf-tower (PR #23)
* `pro/build-nextflow-schemas`: Add optional flag to allow dataset input for nf-tower (PR #23).

# viash-actions v5.0.0

Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set up some variables for consistency
QMD_FILES := $(shell find . -name "README.qmd") # Find all README.qmd files
MD_FILES := $(patsubst %.qmd,%.md,$(QMD_FILES)) # Corresponding MD filenames

# Default target: build all MD files
all: $(MD_FILES)

README.md: README.qmd
quarto render $<
%/README.md: %/README.qmd %/action.yml
quarto render $<

# Clean up generated MD files
clean:
rm -f $(MD_FILES)
49 changes: 35 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
# Github Actions for Viash

This repository stores [Github Actions](https://github.com/features/actions) useful for building and publishing [Viash](https://viash.io) components:

1. [viash-io/viash-actions/setup](setup) - Install Viash
2. [viash-io/viash-actions/ns-list](ns-list) - List Viash components in a repository
3. [viash-io/viash-actions/ns-build](ns-build) - Build a namespace from many viash config files
This repository stores [Github
Actions](https://github.com/features/actions) useful for building and
publishing [Viash](https://viash.io) components:

There are also a few actions that are commonly used in Viash projects:
1. [viash-io/viash-actions/ns-build@v6](ns-build) - viash ns build
1. [viash-io/viash-actions/ns-list@v6](ns-list) - viash ns list
1. [viash-io/viash-actions/setup@v6](setup) - Setup Viash

1. [viash-io/viash-actions/project/cache-and-sync-s3](project/cache-and-sync-s3) - Sync and cache an S3 bucket
2. [viash-io/viash_actions/project/detect-changed-components](project/detect-changed-components) - Detect changed Viash components
There are also some actions that are commonly used in Viash projects:

We recommend using `v3` for your actions.
1. [viash-io/viash-actions/project/build-target@v6](project/build-target) - Build target directory
1. [viash-io/viash-actions/project/detect-changed-components@v6](project/detect-changed-components) - Detect components with changed files
1. [viash-io/viash-actions/project/is-pr@v6](project/is-pr) - Is PR
1. [viash-io/viash-actions/project/sync-and-cache-s3@v6](project/sync-and-cache-s3) - Sync and cache an S3 bucket
1. [viash-io/viash-actions/project/update-docker-engine@v6](project/update-docker-engine) - Update Docker Engine

## Release Management
Finally, there are some [Viash
Pro](https://www.data-intuitive.com/services/viashpro.html) actions:

1. [viash-io/viash-actions/pro/build-nextflow-params@v6](pro/build-nextflow-params) - Build parameter yaml
1. [viash-io/viash-actions/pro/build-nextflow-schemas@v6](pro/build-nextflow-schemas) - Build nf-tower schemas
1. [viash-io/viash-actions/pro/generate-documentation-qmd@v6](pro/generate-documentation-qmd) - Build and publish qmd

This repository uses [GitHub's recommended release management for actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions):
We recommend using `v6` for your actions.

## Release Management

* GitHub releases with tags are used for updates on the actions.
* Semantic versioning is used, with major, minor and possibly patch release.
* Major versions (such as `v1`) will always point to the last minor or patch release for this major version. (when `v1.0.2` is out, `v1` will point to this update to). This means using `viash-io/viash-actions/setup@v1` in your workflow file will automatically get the updated versions. Using `viash-io/viash-actions/[email protected]` will pin a specific release.
* Major version changes (`v1` to `v2`) will often come with breaking changes, and workflows might require manual updates.
This repository uses [GitHub’s recommended release management for
actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions):

- GitHub releases with tags are used for updates on the actions.
- Semantic versioning is used, with major, minor and possibly patch
release.
- Major versions (such as `v1`) will always point to the last minor or
patch release for this major version. (when `v1.0.2` is out, `v1` will
point to this update to). This means using
`viash-io/viash-actions/setup@v1` in your workflow file will
automatically get the updated versions. Using
`viash-io/viash-actions/[email protected]` will pin a specific release.
- Major version changes (`v1` to `v2`) will often come with breaking
changes, and workflows might require manual updates.
54 changes: 54 additions & 0 deletions README.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Github Actions for Viash
format: gfm
---

```{r}
#| include: false
library(tidyverse)

repo_name <- "viash-io/viash-actions"
latest_stable_version <- "v6"

actions <- tibble(
file = list.files(".", full.names = TRUE, recursive = TRUE, pattern = "action.yml"),
path = gsub("^\\./(.*)/action.yml$", "\\1", file),
action = map(file, yaml::read_yaml),
action_name = map_chr(action, "name"),
namespace = ifelse(grepl("/", path), gsub("/.*", "", path), ""),
str = paste0("1. [", repo_name, "/", path, "@", latest_stable_version, "](", path, ") - ", action_name, "\n")
)
```


This repository stores [Github Actions](https://github.com/features/actions) useful for building and publishing [Viash](https://viash.io) components:

```{r}
#| echo: false
cat(actions %>% filter(namespace == "") %>% pull(str) %>% paste(collapse = ""))
```

There are also some actions that are commonly used in Viash projects:

```{r}
#| echo: false
cat(actions %>% filter(namespace == "project") %>% pull(str) %>% paste(collapse = ""))
```

Finally, there are some [Viash Pro](https://www.data-intuitive.com/services/viashpro.html) actions:

```{r}
#| echo: false
cat(actions %>% filter(namespace == "pro") %>% pull(str) %>% paste(collapse = ""))
```

We recommend using ``r latest_stable_version`` for your actions.

## Release Management

This repository uses [GitHub's recommended release management for actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions):

* GitHub releases with tags are used for updates on the actions.
* Semantic versioning is used, with major, minor and possibly patch release.
* Major versions (such as `v1`) will always point to the last minor or patch release for this major version. (when `v1.0.2` is out, `v1` will point to this update to). This means using `viash-io/viash-actions/setup@v1` in your workflow file will automatically get the updated versions. Using `viash-io/viash-actions/[email protected]` will pin a specific release.
* Major version changes (`v1` to `v2`) will often come with breaking changes, and workflows might require manual updates.
63 changes: 43 additions & 20 deletions ns-build/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ns-build
================


# ns-build

<!--
DO NOT EDIT THIS FILE MANUALLY!
This README was generated by running `make`
-->

Build a namespace from many viash config files.

Expand All @@ -11,7 +17,7 @@ each of the arguments.

We recommend using a Linux or MacOS runner if possible.

### Inputs available
### Inputs

- `query`: - *optional*. Filter which components get selected by
component and namespace name. Can be a regex. Example:
Expand All @@ -22,39 +28,56 @@ We recommend using a Linux or MacOS runner if possible.
component name. Can be a regex. Example: “^component1”.
- `src`: - *optional*. A source directory containing viash config files,
possibly structured in a hierarchical folder structure. Default: src/.
- `platform`: - *optional*. Acts as a regular expression to filter the
platform ids specified in the found config files. If this is not
provided, all platforms will be used. If no platforms are defined in a
config, the native platform will be used. In addition, the path to a
platform yaml file can also be specified.
- `platform`: - *optional*. Deprecated. Use –runner and –engine instead.
Acts as a regular expression to filter the platform ids specified in
the found config files. If this is not provided, all platforms will be
used. If no platforms are defined in a config, the native platform
will be used. In addition, the path to a platform yaml file can also
be specified.
- `runner`: - *optional*. Acts as a regular expression to filter the
runner ids specified in the found config files. If this is not
provided, all runners will be used. If no runners are defined in a
config, the executable runner will be used.
- `engine`: - *optional*. Acts as a regular expression to filter the
engine ids specified in the found config files. If this is not
provided, all engines will be used. If no engines are defined in a
config, the native engine will be used.
- `parallel`: - *optional*. Whether or not to run the process in
parallel.
- `config_mod`: - *optional*. Modify a viash config at runtime using
dynamic config modding.
config_mod.
- `target`: - *optional*. A target directory to build the executables
into. Default: target/.
- `setup`: - *optional*. Which setup strategy for creating the container
to use \[Docker Platform only\].
- `colorize`: - *optional*. Specify whether the console output should be
colorized. If not specified, we attempt to detect this automatically.
Possible values are: “true”, “false”, “auto”.
- `loglevel`: - *optional*. Specify the log level in us. Possible values
are: “error”, “warn”, “info”, “debug”, “trace”.
- `setup`: - *optional*. Which docker_setup_strategy for creating the
container to use \[Docker Engine only\].

### Outputs

- `output`: The output of ‘viash ns build’.

## Examples

``` yaml
name: demo of viash ns build
name: Demo of ns-build

on:
branch: main
push:

jobs:
viash-linux:
runs-on: ubuntu-latest
steps:
- uses: viash-io/viash-actions/setup@v3
- name: Check out repository
uses: actions/checkout@v3

- uses: viash-io/viash-actions/ns-build@v3
viash-macos:
runs-on: macos-latest
steps:
- uses: viash-io/viash-actions/setup@v3
- name: Install Viash
uses: viash-io/viash-actions/setup@v6

- uses: viash-io/viash-actions/ns-build@v3
- name: viash ns build
uses: viash-io/viash-actions/ns-build@v6
```
40 changes: 28 additions & 12 deletions ns-build/README.qmd
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
title: ns-build
format: gfm
---

```{r}
#| include: false
library(tidyverse)
# action <- yaml::read_yaml("ns-build/action.yml")
action <- yaml::read_yaml("action.yml")
action_name <- basename(getwd())
```

# `r action_name`

<!--
DO NOT EDIT THIS FILE MANUALLY!
This README was generated by running `make`
-->

`r action$description`

## Usage
Expand All @@ -18,7 +24,7 @@ This action will run `viash ns build`. See the reference documentation on [ns bu

We recommend using a Linux or MacOS runner if possible.

### Inputs available
### Inputs

```{r}
#| echo: false
Expand All @@ -30,26 +36,36 @@ lines <- map_chr(names(action$inputs), function(name) {
knitr::asis_output(paste0(lines, collapse = "\n"))
```

### Outputs

```{r}
#| echo: false
lines <- map_chr(names(action$outputs), function(name) {
output <- action$outputs[[name]]
glue::glue("* `{name}`: {output$description}")
})
knitr::asis_output(paste0(lines, collapse = "\n"))
```

## Examples

```yaml
name: demo of viash ns build
name: Demo of `r action_name`

on:
branch: main
push:

jobs:
viash-linux:
runs-on: ubuntu-latest
steps:
- uses: viash-io/viash-actions/setup@v3
- name: Check out repository
uses: actions/checkout@v3

- uses: viash-io/viash-actions/ns-build@v3
viash-macos:
runs-on: macos-latest
steps:
- uses: viash-io/viash-actions/setup@v3
- name: Install Viash
uses: viash-io/viash-actions/setup@v6

- uses: viash-io/viash-actions/ns-build@v3
- name: `r action$name`
uses: viash-io/viash-actions/ns-build@v6
```

Loading