-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOP-22337] Add logic for handling Samba transfers
- Loading branch information
Ilyas Gasanov
committed
Jan 31, 2025
1 parent
cc69298
commit ddf4ca8
Showing
27 changed files
with
689 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Samba tests | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
DEFAULT_PYTHON: '3.12' | ||
|
||
jobs: | ||
test: | ||
name: Run Samba tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache jars | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cached_jars | ||
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-samba | ||
restore-keys: | | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-samba | ||
${{ runner.os }}-python- | ||
- name: Build Worker Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
tags: mtsrus/syncmaster-worker:${{ github.sha }} | ||
target: test | ||
file: docker/Dockerfile.worker | ||
load: true | ||
cache-from: mtsrus/syncmaster-worker:develop | ||
|
||
- name: Make custom entrypoint script executable | ||
run: chmod +x ./docker/samba/custom_entrypoint.sh | ||
|
||
- name: Docker compose up | ||
run: | | ||
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans | ||
docker compose -f docker-compose.test.yml --profile samba up -d --wait --wait-timeout 200 | ||
env: | ||
WORKER_IMAGE_TAG: ${{ github.sha }} | ||
|
||
- name: Run Samba Tests | ||
run: | | ||
docker compose -f ./docker-compose.test.yml --profile samba exec -T worker coverage run -m pytest -vvv -s -m "worker and samba" | ||
- name: Dump worker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 | ||
with: | ||
images: mtsrus/syncmaster-worker | ||
dest: ./logs | ||
|
||
# This is important, as coverage is exported after receiving SIGTERM | ||
- name: Shutdown | ||
if: always() | ||
run: | | ||
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans | ||
- name: Upload worker logs | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: worker-logs-samba | ||
path: logs/* | ||
|
||
- name: Upload coverage results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-samba | ||
path: reports/* | ||
# https://github.com/actions/upload-artifact/issues/602 | ||
include-hidden-files: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# allow create files and directories | ||
mkdir -p /share/folder | ||
chmod 0777 /share/folder | ||
/entrypoint.sh -u "1000:1000:syncmaster:syncmaster:test_only" -s "SmbShare:/share/folder:rw:syncmaster" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add logic for handling Samba transfers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.