Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 167b57a

Browse files
author
Daniel
authored
Merge pull request #16 from danielTobon43/test-2
Fixes #15
2 parents 4abd2c2 + 67c13c6 commit 167b57a

File tree

7 files changed

+57
-25
lines changed

7 files changed

+57
-25
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- "*"
7+
workflow_dispatch:
8+
79
env:
810
IMAGE_NAME: dbscan-octrees
911

@@ -21,14 +23,11 @@ jobs:
2123
with:
2224
submodules: recursive
2325

24-
- name: Download artifact
25-
uses: actions/download-artifact@master
26+
- name: Artifact (with permissions)
27+
uses: actions/cache@v2
2628
with:
27-
name: build
28-
path: install
29-
30-
- name: Install PCL
31-
run: sudo apt-get update && sudo apt-get install libpcl-dev
29+
path: ${{github.workspace}}/install
30+
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
3231

3332
- name: Docker meta
3433
id: meta
@@ -49,21 +48,30 @@ jobs:
4948
# This is where you will update the PAT to GITHUB_TOKEN
5049
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
5150

52-
- name: Build and push
51+
- name: Build docker image
5352
uses: docker/build-push-action@v3
5453
with:
5554
context: .
56-
file: Dockerfile.release
57-
push: true
55+
file: Dockerfile.release.ubuntu
56+
load: true
5857
tags: ${{ steps.meta.outputs.tags }}
5958
labels: ${{ steps.meta.outputs.labels }}
60-
# cache-from: type=registry,ref=ghcr.io/danieltobon43/${{ env.IMAGE_NAME }}:latest
61-
# cache-to: type=inline
59+
cache-from: type=registry,ref=ghcr.io/danieltobon43/${{ env.IMAGE_NAME }}:sha-${GITHUB_SHA::7}
60+
cache-to: type=inline
6261

6362
- name: Test image
6463
run: |
6564
docker run --rm \
6665
--env="DISPLAY" \
6766
--env="QT_X11_NO_MITSHM=1" \
6867
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
69-
dbscan-octrees:latest
68+
ghcr.io/danieltobon43/${{ env.IMAGE_NAME }}:sha-${GITHUB_SHA::7}
69+
70+
- name: Push docker image
71+
uses: docker/build-push-action@v3
72+
with:
73+
context: .
74+
platforms: linux/amd64
75+
push: true
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: CI (continuous integration)
33
on:
44
push:
55
paths-ignore: ["**.md"]
6-
branches: ["empty"]
7-
# branches-ignore: ["master"]
6+
branches-ignore: ["master"]
7+
tags-ignore:
8+
- "**"
89
workflow_call:
910

1011
jobs:

.github/workflows/lint_and_test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
- name: Install PCL
2020
run: sudo apt-get update && sudo apt-get install libpcl-dev
2121

22-
- name: Configure CMake
22+
- name: Configure CMake project
23+
2324
run: cmake -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=install
2425

2526
- name: Build app
@@ -31,11 +32,12 @@ jobs:
3132
- name: Test app
3233
run: build/app
3334

34-
- name: Store artifact
35-
uses: actions/upload-artifact@master
35+
- name: Artifact (with permissions)
36+
uses: actions/cache@v2
3637
with:
37-
name: build
38-
path: install
38+
path: ${{github.workspace}}/install
39+
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
40+
3941

4042
lint:
4143
needs: [build]

.github/workflows/release-alpine.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
make_install: true
3030

3131
- name: Build Docker Image
32-
run: docker build --file Dockerfile.release --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" .
33-
32+
run: docker build --file Dockerfile.release.alpine --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" .
33+
3434
- name: Test Docker Image
3535
run: |
3636
docker run --rm \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM danieltobon43/pcl-docker:1.12.1-alpine3.15-All AS runtime
22
COPY install/ /usr
33
LABEL org.opencontainers.image.description DESCRIPTION
4-
ENTRYPOINT ["app"]
4+
ENTRYPOINT ["app"]

Dockerfile.release.ubuntu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM ghcr.io/danieltobon43/pcl-docker:latest AS runtime
2+
COPY install /usr
3+
# RUN chmod a+x /usr/bin/app
4+
ENV MESA_LOADER_DRIVER_OVERRIDE i965
5+
6+
# ======== Run binary file ========
7+
ENTRYPOINT ["app"]

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,26 @@ docker run --rm -it \
136136
--env="XAUTHORITY=/tmp/.docker.xauth" \
137137
--env="DISPLAY" \
138138
--name="dbscan" \
139-
--cap-add sys_ptrace \
140-
-p 127.0.0.1:2222:22 \
141139
--volume=[PATH TO YOUR PCD FOLDER]:/tmp \
142140
-t ghcr.io/danieltobon43/dbscan-octrees:latest --cloudfile /tmp/[YOUR PCD FILENAME]
143141
```
144142

143+
If you get something like this after setting `--display` flag it might be related to [this](https://stackoverflow.com/questions/48833451/no-protocol-specified-when-running-a-sudo-su-app-on-ubuntu-linux):
144+
145+
```bash
146+
No protocol specified
147+
```
148+
Try running with the following command or use the provided `.sh` [script](https://github.com/danielTobon43/DBScan-PCL-Optimized/blob/master/scripts/run_dbscan.sh):
149+
```
150+
sudo -sE docker run --rm -it \
151+
--env="DISPLAY" \
152+
--volume=/tmp/.X11-unix:/tmp/.X11-unix:rw \
153+
--volume=/tmp/.docker.xauth:/tmp/.docker.xauth:rw \
154+
--name="dbscan" \
155+
--volume=[PATH TO YOUR PCD FOLDER]:/tmp \
156+
-t ghcr.io/danieltobon43/dbscan-octrees:latest --cloudfile /tmp/[YOUR PCD FILENAME] --display
157+
```
158+
145159
**2. Option 2: shell script**
146160

147161
- Create a `visualizer.sh` file with executable permissions (check this shell script [dbscan-shell-script](https://github.com/danielTobon43/DBScan-PCL-Optimized/blob/master/scripts/run_dbscan.sh)).

0 commit comments

Comments
 (0)