Skip to content

Commit

Permalink
Add initial Nextflow tests (nf-canary)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Dec 9, 2023
1 parent b4feca5 commit 93e22df
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 50 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
- pull_request
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18

- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make build

- name: Store funnel
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel
27 changes: 4 additions & 23 deletions .github/workflows/compliance-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,19 @@
name: Compliance Test

on:
push:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
container: quay.io/ohsu-comp-bio/slurm
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18

- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make build

- name: Store funnel
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel

compliance:
strategy:
fail-fast: false
matrix:
version: [1.0.0, 1.1.0]
db: ["boltdb", "mongodb"]
compute: ["local", "slurm"]
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/ohsu-comp-bio/slurm
Expand Down
46 changes: 19 additions & 27 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Go

on:
- pull_request
- push
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:

lint:
name: lint
runs-on: ubuntu-latest
Expand All @@ -20,26 +21,6 @@ jobs:
version: latest
args: --timeout 3m --verbose -D unused -D errcheck -D staticcheck -D govet -D gosimple -D ineffassign

build:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18

- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make build

- name: Store funnel
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel

unitTest:
runs-on: ubuntu-latest
steps:
Expand All @@ -55,7 +36,6 @@ jobs:

mongoTest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -74,7 +54,6 @@ jobs:
badgerTest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -90,7 +69,6 @@ jobs:
slurmTest:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -107,7 +85,6 @@ jobs:
s3Test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -123,3 +100,18 @@ jobs:
make start-generic-s3
sleep 10
make test-generic-s3
nextflow:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Download funnel
uses: actions/download-artifact@v2
with:
name: funnelBin
path: funnel

- name: Run Nextflow test (nf-canary)
run: funnel task create examples/nextflow.json
28 changes: 28 additions & 0 deletions .github/workflows/workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Workflow Tests

# Only trigger, when the build workflow succeeded
on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
nextflow:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Download funnel
uses: actions/download-artifact@v2
with:
name: funnelBin
path: funnel

- name: Run Nextflow test (nf-canary)
run: |
chmod +x funnel
funnel server run --config funnel.config
funnel task create examples/nextflow.json
26 changes: 26 additions & 0 deletions examples/nextflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "Nextflow Canary Tests",
"description": "Run the Nextflow Canary tests to verify Nextflow support",
"tags": {
"Project": "Nextflow"
},
"outputs": [
{
"url": "/tmp",
"path": "/.nextflow/",
"type": "DIRECTORY"
},
{
"url": "/tmp",
"path": "/root/",
"type": "DIRECTORY"
}
],
"executors": [
{
"image": "quay.io/ohsu-comp-bio/nf-canary",
"command": ["sh", "-c", "cd /root; nextflow -Djdk.lang.Process.launchMechanism=vfork run /nf-canary/main.nf"]
}
]
}

9 changes: 9 additions & 0 deletions funnel.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
LocalStorage:
# Whitelist of local directory paths which Funnel is allowed to access.
AllowedDirs:
- ./
- /tmp

Worker:
LeaveWorkDir: true

18 changes: 18 additions & 0 deletions storage/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,24 @@ func linkFile(ctx context.Context, source string, dest string) error {
if same {
return nil
}
if source != parent {
fileInfo, err := os.Stat(parent)
if err != nil{
return err
}
if fileInfo.IsDir() {
fmt.Printf("DEBUG: %v is a symlink to directory %v.\n", source, parent)
fmt.Printf("DEBUG dest: %v\n", dest)
// create a symbolic link from source to parent
err = os.Symlink(parent, dest)
if err != nil {
return fmt.Errorf("failed to create symbolic link: %v", err)
}

return nil
}
}

err = os.Link(parent, dest)
if err != nil {
err = copyFile(ctx, source, dest)
Expand Down

0 comments on commit 93e22df

Please sign in to comment.