forked from nextflow-io/nf-nomad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
213 lines (183 loc) · 6.56 KB
/
Makefile
File metadata and controls
213 lines (183 loc) · 6.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
config ?= compileClasspath
ifdef module
mm = :${module}:
else
mm =
endif
NOMAD_ADDR ?= http://localhost:4646
NF_NOMAD_LOCAL_NOMAD_ADDR ?= http://localhost:4646
NF_NOMAD_LOCAL_STACK_DIR ?= ${CURDIR}/../../infrastructure/03_automation/035_terraform/local-nomad-minio
NF_NOMAD_LOCAL_WORK_DIR ?= ${NF_NOMAD_LOCAL_STACK_DIR}/work
INTEGRATION_ARGS ?=
NF_TEST_DIR ?= src/e2e
NF_TEST_ARGS ?= tests/hello-remote.nf.test
#
# Clean, compile, package and install targets
#
clean:
./gradlew clean
@echo "✓ Project cleaned"
compile:
./gradlew compileGroovy
@echo "✓ Compilation complete `date`"
build: clean compile
./gradlew build
@echo "✓ Build complete `date`"
#
# Package the plugin as a JAR file
#
package: build
./gradlew assemble
@echo "✓ Plugin packaged as JAR"
#
# Install plugin locally to $HOME/.nextflow/plugins
# This allows Nextflow to use the plugin in development
#
install-local: clean compile
@echo "Installing nf-nomad plugin locally to ~/.nextflow/plugins..."
@mkdir -p ${HOME}/.nextflow/plugins
./gradlew installPlugin --rerun-tasks
@echo "✓ Plugin installed to ${HOME}/.nextflow/plugins"
#
# Install a development version (99.99.99) for end-to-end testing
#
install-dev: clean compile
@echo "Installing nf-nomad development version (99.99.99) to ~/.nextflow/plugins..."
@mkdir -p ${HOME}/.nextflow/plugins
./gradlew clean installPlugin -Pversion=99.99.99 --rerun-tasks
@echo "✓ Development version installed to ${HOME}/.nextflow/plugins"
#
# Uninstall the plugin from local installation
#
uninstall-local:
@echo "Uninstalling nf-nomad plugin from ~/.nextflow/plugins..."
@rm -rf ${HOME}/.nextflow/plugins/nf-nomad*
@echo "✓ Plugin uninstalled"
check:
./gradlew check
#
# Show dependencies try `make deps config=runtime`, `make deps config=google`
#
deps:
./gradlew -q ${mm}dependencies --configuration ${config}
deps-all:
./gradlew -q dependencyInsight --configuration ${config} --dependency ${module}
#
# Refresh SNAPSHOTs dependencies
#
refresh:
./gradlew --refresh-dependencies
#
# Run all tests or selected ones
#
test:
ifndef class
./gradlew ${mm}test
else
./gradlew ${mm}test --tests ${class}
endif
#
# Integration test targets — source the cluster env first, then run:
# make test-mock (unit + mock tests with MockWebServer)
# make test-local (unit + integration against local-nomad-minio)
# make test-oci (unit + integration against oci-vm-nomad)
#
test-mock:
./gradlew ${mm}test -PtestEnv=mock
test-local:
./gradlew ${mm}test -PtestEnv=local
test-oci:
./gradlew ${mm}test -PtestEnv=oci
test-integration:
NOMAD_ADDR=${NF_NOMAD_LOCAL_NOMAD_ADDR} \
NF_NOMAD_LOCAL_NOMAD_ADDR=${NF_NOMAD_LOCAL_NOMAD_ADDR} \
NF_NOMAD_LOCAL_STACK_DIR=${NF_NOMAD_LOCAL_STACK_DIR} \
NF_NOMAD_LOCAL_WORK_DIR=${NF_NOMAD_LOCAL_WORK_DIR} \
./validation/run-integration.sh --build ${INTEGRATION_ARGS}
# nf-test E2E targets (local Nomad cluster)
nf-test-update:
cd ${NF_TEST_DIR} && ./nf-test update
test-nf-test:
@mkdir -p ${NF_NOMAD_LOCAL_WORK_DIR}/assets ${NF_NOMAD_LOCAL_WORK_DIR}/cache
NOMAD_ADDR=${NF_NOMAD_LOCAL_NOMAD_ADDR} \
NF_NOMAD_LOCAL_NOMAD_ADDR=${NF_NOMAD_LOCAL_NOMAD_ADDR} \
NF_NOMAD_LOCAL_STACK_DIR=${NF_NOMAD_LOCAL_STACK_DIR} \
NF_NOMAD_LOCAL_WORK_DIR=${NF_NOMAD_LOCAL_WORK_DIR} \
NXF_ASSETS=${NF_NOMAD_LOCAL_WORK_DIR}/assets \
NXF_CACHE_DIR=${NF_NOMAD_LOCAL_WORK_DIR}/cache \
cd ${NF_TEST_DIR} && ./nf-test test ${NF_TEST_ARGS} --verbose
#
# Upload JAR artifacts to Maven Central
#
upload:
./gradlew upload
upload-plugins:
./gradlew plugins:upload
publish-index:
./gradlew plugins:publishIndex
#
# Development workflow targets
#
# Use: make install-dev followed by ./launch.sh to test with the plugin
#
dev-setup: install-dev
@echo ""
@echo "✓ Development environment ready!"
@echo ""
@echo "To test the plugin, run:"
@echo " ./launch.sh run main.nf -plugins nf-nomad@99.99.99"
@echo ""
#
# List installed plugins
#
list-plugins:
@echo "Installed plugins in ~/.nextflow/plugins:"
@ls -la ${HOME}/.nextflow/plugins/ 2>/dev/null || echo "No plugins installed yet"
#
# Display help for Makefile targets
#
help:
@echo "nf-nomad Plugin Build Targets:"
@echo ""
@echo "Build & Package Targets:"
@echo " make clean - Clean build artifacts"
@echo " make compile - Compile Groovy sources"
@echo " make build - Clean and build the project"
@echo " make package - Build and package plugin as JAR"
@echo ""
@echo "Installation Targets:"
@echo " make install-local - Install plugin to ~/.nextflow/plugins (uses current version)"
@echo " make install-dev - Install development version (99.99.99) for testing"
@echo " make uninstall-local - Remove plugin from ~/.nextflow/plugins"
@echo " make dev-setup - Install dev version and show how to test"
@echo " make list-plugins - List installed plugins"
@echo ""
@echo "Test Targets:"
@echo " make test - Run unit tests only"
@echo " make test-mock - Run unit + mock tests"
@echo " make test-local - Run unit + local integration tests"
@echo " make test-oci - Run unit + OCI integration tests"
@echo " make test-integration - Run local real-pipeline integration suite (hello + demo + rnaseq)"
@echo " make nf-test-update - Install/update nf-test runtime under ~/.nf-test"
@echo " make test-nf-test - Run nf-test E2E tests (default: tests/hello-remote.nf.test)"
@echo ""
@echo "Other Targets:"
@echo " make check - Run all checks (compile + tests)"
@echo " make compile - Compile sources"
@echo " make deps - Show project dependencies"
@echo " make deps-all - Show detailed dependency information"
@echo " make refresh - Refresh SNAPSHOT dependencies"
@echo " make upload - Upload JAR to Maven Central"
@echo " make upload-plugins - Upload plugins"
@echo " make publish-index - Publish plugin index"
@echo ""
@echo "Examples:"
@echo " make install-dev # Install development version"
@echo " make test-local # Run local integration tests"
@echo " make test-integration # Run real pipeline integration suite"
@echo " make test-integration INTEGRATION_ARGS='--skip-rnaseq' # Faster local smoke run"
@echo " make test-nf-test # Run default nf-test hello E2E"
@echo " make test-nf-test NF_TEST_ARGS='tests/*.nf.test' # Run all nf-test specs"
@echo " make dev-setup # Setup dev environment with instructions"
@echo " make test class=MyTestClass # Run specific test class"
@echo ""