-
Notifications
You must be signed in to change notification settings - Fork 781
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
build: use Task #1535
build: use Task #1535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get rid of scripts/run_action.sh
now?
README.md
Outdated
@@ -41,7 +41,7 @@ See [Shadowsocks resistance against detection and blocking](docs/shadowsocks.md) | |||
1. **Start the server** | |||
|
|||
```sh | |||
npm run action shadowbox/server/start | |||
task shadowbox:server:start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Task as a prerequisite above for easy setup instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mention Go as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Go. The task binary is now built on npm install
``` | ||
|
||
- **Docker Container** | ||
|
||
```sh | ||
npm run action shadowbox/docker/start | ||
task shadowbox:docker:start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task doesn't exist. You only specified docker:build
. Can you create one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I forgot about it. I'll work on it.
src/shadowbox/Taskfile.yml
Outdated
# Copy entrypoint command | ||
- cp '{{joinPath .TASKFILE_DIR "docker/cmd.sh"}}' '{{.IMAGE_ROOT}}/' | ||
# Build image with given root | ||
- podman build --force-rm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this will be surprising to most users - Docker is still exponentially more popular. A user trying to run the server will run task shadowbox:docker:build
thinking they're building an image using their Docker installation, and it fails on a missing podman installation, which isn't mentioned anywhere. If nothing else, update the README to replace Docker with Podman.
However, as many users will have Docker installed already, an additional installation could just put them off trying out the instructions to play with the server. Maybe we can explicitly create a shadowbox:podman:build
or check if podman
exists and fallback to Docker if not.
PS: I'm not arguing that Docker is better than Podman (it's not), I'm just hoping to keep the on-ramp for new users easy and predictable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. It was for testing, I didn't actually intend to change. I've reverted to docker, but have an option to override. I can now do ./task shadowbox:docker:build DOCKER=podman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, the override is cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool. Maybe we can support building from Windows once we migrate to a cross-platform build pipeline in the future.
src/metrics_server/README.md
Outdated
``` | ||
- Integration test | ||
```sh | ||
npm run action metrics_server/test_integration | ||
task metrics_server:integration:test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit shall we rename it to integration_test
? Cuz we don't have other sub-tasks for integration
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. That aligns with shadowbox too. Renamed
src/metrics_server/Taskfile.yml
Outdated
deps: [build] | ||
cmds: | ||
- cp '{{.TASKFILE_DIR}}/config_dev.json' '{{.SERVER_DIR}}/config.json' | ||
- npx node '{{.SERVER_DIR}}/index.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need npx
here? Can we just use node {{.SERVER_DIR}}/index.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
README.md
Outdated
@@ -41,7 +41,7 @@ See [Shadowsocks resistance against detection and blocking](docs/shadowsocks.md) | |||
1. **Start the server** | |||
|
|||
```sh | |||
npm run action shadowbox/server/start | |||
task shadowbox:server:start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mention Go as well.
src/shadowbox/Taskfile.yml
Outdated
TARGET_OS: '{{.TARGET_OS | default "linux"}}' | ||
TARGET_ARCH: '{{.TARGET_ARCH | default "x86_64"}}' | ||
GOOS: '{{get (dict "macos" "darwin") .TARGET_OS | default .TARGET_OS}}' | ||
GOARCH: '{{get (dict "x86_64" "arm64") .TARGET_ARCH | default .TARGET_ARCH}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOARCH: '{{get (dict "x86_64" "arm64") .TARGET_ARCH | default .TARGET_ARCH}}' | |
GOARCH: '{{get (dict "x86_64" "amd64") .TARGET_ARCH | default .TARGET_ARCH}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but please don't forget to add the docker:start
task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM, please make sure the CI job passes.
Taskfile.yml
Outdated
clean: | ||
desc: Clean output files | ||
cmds: | ||
- rm -rf .task src/*/node_modules/ build/ node_modules/ third_party/shellcheck/download/ third_party/*/bin third_party/jsign/*.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove the ./task
binary built by npm install
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Done
docker:start added. It was a pain to make it work. Ran into cross-compilation issues... |
We now build outline-ss-server directly and cross-compile the docker image.