Repository navigation
feat(docker-compose): Add Docker Compose stack that mounts a local directory. #440
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
Changes from 6 commits
da04bff
d5f7d03
8213b8b
f0fb689
f40d736
ed735a3
02f94e5
672c58d
8daa1fd
e7a6215
65601b9
74d84ef
5d02d68
b640495
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,3 +38,54 @@ tasks: | |
| compose:clean: | ||
| dir: "{{.G_SPIDER_COMPOSE_DIR}}" | ||
| cmd: "docker compose --file compose.yaml down --volumes --remove-orphans" | ||
|
|
||
| # Builds Spider and its images, then starts a local deployment. | ||
| # | ||
| # @param {string} SPIDER_WORKER_LIBRARY_DIR The host directory containing the libraries. | ||
| compose:local:build-and-up: | ||
|
sitaowang1998 marked this conversation as resolved.
Resolved
|
||
| cmds: | ||
| - task: ":build:rust" | ||
| - task: "build" | ||
|
sitaowang1998 marked this conversation as resolved.
Resolved
|
||
| - task: "compose:local:up" | ||
| vars: | ||
| SPIDER_STORAGE_IMAGE_REF: | ||
| sh: "sed -n '1p' '{{.G_BUILD_DIR}}/spider-storage-image.id'" | ||
| SPIDER_SCHEDULER_IMAGE_REF: | ||
| sh: "sed -n '1p' '{{.G_BUILD_DIR}}/spider-scheduler-image.id'" | ||
| SPIDER_WORKER_IMAGE_REF: | ||
| sh: "sed -n '1p' '{{.G_BUILD_DIR}}/spider-worker-image.id'" | ||
| SPIDER_WORKER_LIBRARY_DIR: "{{.SPIDER_WORKER_LIBRARY_DIR}}" | ||
|
|
||
| # Starts a local Spider deployment with libraries mounted into every worker. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add image override to the docstring
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are already listed as parameters.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my latest review comment, that's what I mean by this
sitaowang1998 marked this conversation as resolved.
Resolved
|
||
| # | ||
| # @param {string} SPIDER_STORAGE_IMAGE_REF The storage image reference. | ||
| # @param {string} SPIDER_SCHEDULER_IMAGE_REF The scheduler image reference. | ||
| # @param {string} SPIDER_WORKER_IMAGE_REF The worker image reference. | ||
| # @param {string} SPIDER_WORKER_LIBRARY_DIR The host directory containing the libraries. | ||
| compose:local:up: | ||
| env: | ||
| SPIDER_STORAGE_IMAGE_REF: "{{.SPIDER_STORAGE_IMAGE_REF}}" | ||
| SPIDER_SCHEDULER_IMAGE_REF: "{{.SPIDER_SCHEDULER_IMAGE_REF}}" | ||
| SPIDER_WORKER_IMAGE_REF: "{{.SPIDER_WORKER_IMAGE_REF}}" | ||
| SPIDER_WORKER_LIBRARY_DIR: >- | ||
| {{- if .SPIDER_WORKER_LIBRARY_DIR}} | ||
| {{- if osIsAbs .SPIDER_WORKER_LIBRARY_DIR}} | ||
| {{- osClean .SPIDER_WORKER_LIBRARY_DIR}} | ||
| {{- else}} | ||
| {{- joinPath .ROOT_DIR .SPIDER_WORKER_LIBRARY_DIR}} | ||
| {{- end}} | ||
| {{- end}} | ||
| dir: "{{.G_SPIDER_COMPOSE_DIR}}" | ||
| cmd: >- | ||
| docker compose --project-name spider-local --file compose.yaml | ||
| --file compose.local.yaml up --detach --wait --wait-timeout 300 | ||
|
|
||
| compose:local:down: | ||
| dir: "{{.G_SPIDER_COMPOSE_DIR}}" | ||
| cmd: "docker compose --project-name spider-local --file compose.yaml down" | ||
|
|
||
| compose:local:clean: | ||
| dir: "{{.G_SPIDER_COMPOSE_DIR}}" | ||
| cmd: >- | ||
| docker compose --project-name spider-local --file compose.yaml down | ||
| --volumes --remove-orphans | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| services: | ||
| spider-worker: | ||
| volumes: | ||
| - type: "bind" | ||
| source: "${SPIDER_WORKER_LIBRARY_DIR:?}" | ||
| target: "${SPIDER_WORKER_PACKAGE_DIR:-/opt/spider/packages}" | ||
| read_only: true |
Uh oh!
There was an error while loading. Please reload this page.