blanchon commited on
Commit
c9dc57e
·
1 Parent(s): 8052017
.github/workflows/docker.yml DELETED
@@ -1,120 +0,0 @@
1
- name: Docker Build and Test
2
-
3
- on:
4
- push:
5
- branches: [ main, develop ]
6
- paths:
7
- - 'services/transport-server/**'
8
- pull_request:
9
- branches: [ main ]
10
- paths:
11
- - 'services/transport-server/**'
12
-
13
- env:
14
- REGISTRY: ghcr.io
15
- IMAGE_NAME: lerobot-arena/transport-server
16
-
17
- jobs:
18
- build-and-test:
19
- runs-on: ubuntu-latest
20
- permissions:
21
- contents: read
22
- packages: write
23
-
24
- steps:
25
- - name: Checkout repository
26
- uses: actions/checkout@v4
27
-
28
- - name: Set up Docker Buildx
29
- uses: docker/setup-buildx-action@v3
30
-
31
- - name: Log in to Container Registry
32
- if: github.event_name != 'pull_request'
33
- uses: docker/login-action@v3
34
- with:
35
- registry: ${{ env.REGISTRY }}
36
- username: ${{ github.actor }}
37
- password: ${{ secrets.GITHUB_TOKEN }}
38
-
39
- - name: Extract metadata
40
- id: meta
41
- uses: docker/metadata-action@v5
42
- with:
43
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44
- tags: |
45
- type=ref,event=branch
46
- type=ref,event=pr
47
- type=sha,prefix={{branch}}-
48
- type=raw,value=latest,enable={{is_default_branch}}
49
-
50
- - name: Build Docker image
51
- uses: docker/build-push-action@v5
52
- with:
53
- context: ./services/transport-server
54
- file: ./services/transport-server/Dockerfile
55
- push: false
56
- tags: ${{ steps.meta.outputs.tags }}
57
- labels: ${{ steps.meta.outputs.labels }}
58
- cache-from: type=gha
59
- cache-to: type=gha,mode=max
60
- load: true
61
-
62
- - name: Test Docker image
63
- run: |
64
- # Start the container in background
65
- docker run -d --name test-container -p 7860:7860 -e SERVE_FRONTEND=true ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
66
-
67
- # Wait for container to start
68
- sleep 30
69
-
70
- # Test health endpoint
71
- curl -f http://localhost:7860/health || exit 1
72
-
73
- # Test API health endpoint
74
- curl -f http://localhost:7860/api/health || exit 1
75
-
76
- # Test frontend is served
77
- curl -f http://localhost:7860/ | grep -q "LeRobot Arena" || exit 1
78
-
79
- # Check logs for errors
80
- docker logs test-container
81
-
82
- # Stop container
83
- docker stop test-container
84
- docker rm test-container
85
-
86
- - name: Push Docker image
87
- if: github.event_name != 'pull_request'
88
- uses: docker/build-push-action@v5
89
- with:
90
- context: ./services/transport-server
91
- file: ./services/transport-server/Dockerfile
92
- push: true
93
- tags: ${{ steps.meta.outputs.tags }}
94
- labels: ${{ steps.meta.outputs.labels }}
95
- cache-from: type=gha
96
- cache-to: type=gha,mode=max
97
-
98
- security-scan:
99
- runs-on: ubuntu-latest
100
- needs: build-and-test
101
- permissions:
102
- contents: read
103
- security-events: write
104
-
105
- steps:
106
- - name: Checkout repository
107
- uses: actions/checkout@v4
108
-
109
- - name: Run Trivy vulnerability scanner
110
- uses: aquasecurity/trivy-action@master
111
- with:
112
- image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
113
- format: 'sarif'
114
- output: 'trivy-results.sarif'
115
-
116
- - name: Upload Trivy scan results to GitHub Security tab
117
- uses: github/codeql-action/upload-sarif@v2
118
- if: always()
119
- with:
120
- sarif_file: 'trivy-results.sarif'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/sync-to-hf.yml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face hub
2
+ on:
3
+ push:
4
+ branches: [main]
5
+
6
+ # to run this workflow manually from the Actions tab
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ sync-to-hub:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+ lfs: true
17
+ submodules: recursive
18
+ - name: Push to hub
19
+ env:
20
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
21
+ run: git push https://blanchon:$HF_TOKEN@huggingface.co/spaces/blanchon/RobotHub-TransportServer main
README.md CHANGED
@@ -5,7 +5,6 @@ colorFrom: blue
5
  colorTo: purple
6
  sdk: docker
7
  app_port: 7860
8
- dockerfile_path: services/transport-server/Dockerfile
9
  suggested_hardware: cpu-upgrade
10
  suggested_storage: small
11
  short_description: Real-time robotics control
 
5
  colorTo: purple
6
  sdk: docker
7
  app_port: 7860
 
8
  suggested_hardware: cpu-upgrade
9
  suggested_storage: small
10
  short_description: Real-time robotics control