Skip to content

Commit

Permalink
Add an e2e workflow to test FUSE mount
Browse files Browse the repository at this point in the history
  • Loading branch information
Woellchen committed Aug 30, 2022
1 parent 484bba7 commit af8ea2f
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 3 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "go: build binary"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.head_ref }}/e2e
cancel-in-progress: true

permissions:
contents: read

defaults:
run:
working-directory: docker

jobs:
e2e:
name: End to End
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2

- name: Build SeaweedFS + docker image
run: make build

- name: Install mount binary
run: cp ./weed /usr/local/sbin/mount.weed

- name: Start containers
run: docker-compose -f ./compose/e2e.yml up --wait

- name: Mount
run: mount -t weed fuse /mnt -o 'filer=localhost:8888,filer.path=/'

- name: TEST
run: ls -las --color /mnt; echo 'fregregerger' > /mnt/test; ls -las --color /mnt; cat /mnt/test

- name: Stop containers
if: always()
run: docker-compose -f ./compose/e2e.yml down --volumes --remove-orphans --rmi all
12 changes: 10 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ jobs:
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2

- name: Get dependencies
run: |
cd weed; go get -v -t -d ./...
run: cd weed; go get -v -t -d ./...

- name: Build
run: cd weed; go build -tags "elastic gocdk sqlite ydb tikv" -v .

- name: Test
run: cd weed; go test -tags "elastic gocdk sqlite ydb tikv" -v ./...

- name: Start e2e containers
run: |
docker-compose -f "docker-compose.yml" up -d --build
cd weed; go get -v -t -d ./...
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
1 change: 1 addition & 0 deletions docker/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN mkdir -p /etc/seaweedfs
COPY ./filer.toml /etc/seaweedfs/filer.toml
COPY ./entrypoint.sh /entrypoint.sh
RUN apk add fuse # for weed mount
RUN apk add curl # for health checks

# volume server grpc port
EXPOSE 18080
Expand Down
1 change: 0 additions & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ binary:

build: binary
docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .
rm ./weed

go_build: # make go_build tags=elastic,ydb,gocdk,hdfs,5BytesOffset
docker build --build-arg TAGS=$(tags) --no-cache -t chrislusf/seaweedfs:go_build -f Dockerfile.go_build .
Expand Down
65 changes: 65 additions & 0 deletions docker/compose/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '3.9'

services:
master:
image: chrislusf/seaweedfs:local
ports:
- "9333:9333"
- "19333:19333"
command: "-v=1 master -ip=master"
healthcheck:
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:9333/cluster/healthz" ]
interval: 3s
timeout: 30s

volume:
image: chrislusf/seaweedfs:local
ports:
- "8080:8080"
- "18080:18080"
command: "-v=1 volume -mserver=master:9333 -port=8080 -ip=volume -preStopSeconds=1"
healthcheck:
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:8080/healthz" ]
interval: 3s
timeout: 30s
depends_on:
master:
condition: service_healthy

filer:
image: chrislusf/seaweedfs:local
ports:
- "8111:8111"
- "8888:8888"
- "18888:18888"
command: "-v=1 filer -ip.bind=0.0.0.0 -master='master:9333'"
healthcheck:
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:8888" ]
interval: 3s
timeout: 30s
depends_on:
master:
condition: service_healthy
volume:
condition: service_healthy

mount:
image: chrislusf/seaweedfs:local
cap_add:
- SYS_ADMIN
deploy:
resources:
limits:
memory: 4096m
command: "-v=4 mount -filer='filer:8888' -dirAutoCreate -dir=/mnt/seaweedfs -cacheCapacityMB=100 -concurrentWriters=128"
healthcheck:
test: [ "CMD", "mountpoint", "-q", "--", "/mnt/seaweedfs" ]
interval: 3s
timeout: 30s
depends_on:
master:
condition: service_healthy
volume:
condition: service_healthy
filer:
condition: service_healthy

0 comments on commit af8ea2f

Please sign in to comment.