Browse Source

fix: copy Maven artifacts into workspace instead of mounting $HOME/.m2

Issue: Docker volume mount from $HOME/.m2 wasn't working in GitHub Actions
- Container couldn't access the locally built SNAPSHOT JARs
- Maven failed with 'Could not find artifact seaweedfs-hadoop3-client:3.80.1-SNAPSHOT'

Solution: Copy Maven repository into workspace
1. In CI: Copy ~/.m2/repository/com/seaweedfs to test/java/spark/.m2/repository/com/
2. docker-compose.yml: Mount ./.m2 (relative path in workspace)
3. .gitignore: Added .m2/ to ignore copied artifacts

Why this works:
- Workspace directory (.) is successfully mounted as /workspace
- ./.m2 is inside workspace, so it gets mounted too
- Container sees artifacts at /root/.m2/repository/com/seaweedfs/...
- Maven finds the 3.80.1-SNAPSHOT JARs with our debug logging!

Next run should finally show the [DEBUG-2024] logs! 🎯
pull/7526/head
chrislu 6 days ago
parent
commit
f52d2902b2
  1. 16
      .github/workflows/spark-integration-tests.yml
  2. 1
      test/java/spark/.gitignore
  3. 2
      test/java/spark/docker-compose.yml

16
.github/workflows/spark-integration-tests.yml

@ -199,14 +199,18 @@ jobs:
curl -s http://localhost:9333/dir/status | jq '.' || echo "jq not available"
echo "✓ Volume server registered, volumes will be created on-demand during tests"
- name: Verify Maven artifacts before tests
- name: Prepare Maven repository for Docker
working-directory: test/java/spark
run: |
echo "Verifying Maven artifacts are available in ~/.m2/repository..."
echo "Checking for SNAPSHOT artifacts:"
find ~/.m2/repository/com/seaweedfs -name "*3.80.1-SNAPSHOT*" 2>/dev/null | sort || echo "No SNAPSHOT artifacts found!"
echo "Copying Maven artifacts into workspace for Docker access..."
mkdir -p .m2/repository/com
cp -r ~/.m2/repository/com/seaweedfs .m2/repository/com/
echo "Verifying copied artifacts:"
find .m2/repository/com/seaweedfs -name "*3.80.1-SNAPSHOT*" | sort
echo ""
echo "All seaweedfs JARs:"
find ~/.m2/repository/com/seaweedfs -name "*.jar" 2>/dev/null | sort
echo "Directory size:"
du -sh .m2/repository/com/seaweedfs
- name: Run Spark integration tests in Docker
working-directory: test/java/spark

1
test/java/spark/.gitignore

@ -1,5 +1,6 @@
# Maven
target/
.m2/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup

2
test/java/spark/docker-compose.yml

@ -71,7 +71,7 @@ services:
container_name: seaweedfs-spark-tests
volumes:
- .:/workspace
- ${HOME}/.m2:/root/.m2
- ./.m2:/root/.m2
working_dir: /workspace
environment:
- SEAWEEDFS_TEST_ENABLED=true

Loading…
Cancel
Save