Skip to content

Commit 0398c50

Browse files
authored
Merge pull request #3 from IGNF/dev
Bump version to 2.0.0 on main
2 parents 2bf1d58 + 9a011ea commit 0398c50

35 files changed

+300
-161
lines changed

.github/workflows/cicd_deploy.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
2+
name: cicd_deploy
3+
4+
on:
5+
# Also run when the pull request merges (which generates a push)
6+
# So that we can tag the docker image appropriately.
7+
push:
8+
tags: [ 'v*.*.*' ]
9+
10+
env:
11+
IMAGE_NAME: ${{ github.repository }}
12+
REGISTRY: ghcr.io
13+
TEST_TAG: ${{ github.repository }}:test
14+
15+
jobs:
16+
deploy_docker:
17+
runs-on: ubuntu-latest
18+
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout branch
25+
uses: actions/checkout@v4
26+
27+
- name: Build the Docker image
28+
id: build
29+
uses: docker/build-push-action@v6
30+
with:
31+
load: true
32+
tags: ${{ env.TEST_TAG }}
33+
34+
# run the test on the docker image
35+
- name: Run tests in docker image
36+
run: >
37+
docker run
38+
--ipc=host
39+
${{ env.TEST_TAG }}
40+
python -m pytest -s
41+
--log-cli-level=DEBUG
42+
--log-format="%(asctime)s %(levelname)s %(message)s"
43+
--log-date-format="%Y-%m-%d %H:%M:%S"
44+
-m "not functional_test"
45+
46+
# Login against a Docker registry except on PR
47+
# https://github.com/docker/login-action
48+
- name: Log into registry ${{ env.REGISTRY }}
49+
if: github.event_name != 'pull_request'
50+
uses: docker/login-action@v3.4
51+
with:
52+
registry: ${{ env.REGISTRY }}
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
# Extract metadata (tags, labels) for Docker
57+
# https://github.com/docker/metadata-action
58+
- name: Extract Docker metadata
59+
if: github.event_name != 'pull_request'
60+
id: meta
61+
uses: docker/metadata-action@v5
62+
with:
63+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
64+
65+
# Build a Docker image with Buildx (don't on PR)
66+
# https://github.com/docker/build-push-action
67+
- name: Build and push Docker image
68+
if: github.event_name != 'pull_request'
69+
id: build-and-push
70+
uses: docker/build-push-action@v6
71+
with:
72+
context: .
73+
push: true
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
77+
deploy-pypi:
78+
runs-on: ubuntu-latest
79+
80+
environment:
81+
name: pypi
82+
url: https://pypi.org/p/ign-las-digital-models
83+
84+
permissions:
85+
contents: read
86+
packages: write
87+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
88+
89+
steps:
90+
- name: Checkout branch
91+
uses: actions/checkout@v4
92+
93+
# See https://github.com/marketplace/actions/setup-micromamba
94+
- name: setup-micromamba
95+
uses: mamba-org/setup-micromamba@v2
96+
with:
97+
environment-file: environment.yml
98+
environment-name: las_digital_models # activate the environment
99+
cache-environment: true
100+
cache-downloads: true
101+
generate-run-shell: true
102+
103+
- name: Run tests with pytest
104+
shell: micromamba-shell {0}
105+
run: python -m pytest ./test -s --log-cli-level DEBUG
106+
107+
- name: Build pip package
108+
shell: micromamba-shell {0}
109+
run: make build
110+
111+
- name: pypi-publish
112+
uses: pypa/gh-action-pypi-publish@v1.12.4

.github/workflows/cicd_full.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
name: cicd_full
3+
4+
on:
5+
# Run tests for pull-requests on master
6+
pull_request:
7+
branches:
8+
- main
9+
# Also run when the pull request merges (which generates a push)
10+
# So that we can tag the docker image appropriately.
11+
push:
12+
branches:
13+
- dev
14+
15+
env:
16+
IMAGE_NAME: ${{ github.repository }}
17+
REGISTRY: ghcr.io
18+
TEST_TAG: ${{ github.repository }}:test
19+
20+
jobs:
21+
deploy_docker:
22+
runs-on: ubuntu-latest
23+
24+
permissions:
25+
contents: read
26+
packages: write
27+
28+
steps:
29+
- name: Checkout branch
30+
uses: actions/checkout@v4
31+
32+
- name: Build the Docker image
33+
id: build
34+
uses: docker/build-push-action@v6
35+
with:
36+
load: true
37+
tags: ${{ env.TEST_TAG }}
38+
39+
# run the test on the docker image
40+
- name: Run tests in docker image
41+
run: >
42+
docker run
43+
--ipc=host
44+
${{ env.TEST_TAG }}
45+
python -m pytest -s
46+
--log-cli-level=DEBUG
47+
--log-format="%(asctime)s %(levelname)s %(message)s"
48+
--log-date-format="%Y-%m-%d %H:%M:%S"
49+
-m "not functional_test"
50+
51+
test_local:
52+
runs-on: ubuntu-latest
53+
permissions:
54+
contents: read
55+
packages: write
56+
57+
steps:
58+
- name: Checkout branch
59+
uses: actions/checkout@v4
60+
61+
# See https://github.com/marketplace/actions/setup-micromamba
62+
- name: setup-micromamba
63+
uses: mamba-org/setup-micromamba@v2
64+
with:
65+
environment-file: environment.yml
66+
environment-name: las_digital_models # activate the environment
67+
cache-environment: true
68+
cache-downloads: true
69+
generate-run-shell: true
70+
71+
- name: Run tests with pytest
72+
shell: micromamba-shell {0}
73+
run: >
74+
python -m pytest -s
75+
--log-cli-level=DEBUG
76+
--log-format="%(asctime)s %(levelname)s %(message)s"
77+
--log-date-format="%Y-%m-%d %H:%M:%S"

.github/workflows/cicd_light.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: cicd_light
2+
3+
on:
4+
# Run tests for non-draft pull request on dev
5+
pull_request:
6+
branches:
7+
- dev
8+
9+
10+
jobs:
11+
test_light:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout branch
19+
uses: actions/checkout@v4
20+
21+
# See https://github.com/marketplace/actions/setup-micromamba
22+
- name: setup-micromamba
23+
uses: mamba-org/setup-micromamba@v2
24+
with:
25+
environment-file: environment.yml
26+
environment-name: las_digital_models # activate the environment
27+
cache-environment: true
28+
cache-downloads: true
29+
generate-run-shell: true
30+
31+
- name: Run tests with pytest
32+
shell: micromamba-shell {0}
33+
run: >
34+
python -m pytest -s
35+
--log-cli-level=DEBUG
36+
--log-format="%(asctime)s %(levelname)s %(message)s"
37+
--log-date-format="%Y-%m-%d %H:%M:%S"
38+
39+

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ test/tmp/
66
*.log
77

88
# Library deployment
9-
ign_mnx.egg-info
9+
*.egg-info
1010
dist

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "pdalTools"]
2-
path = pdalTools
3-
url = ssh://git@gitlab.forge-idi.ign.fr:10022/Lidar/pdalTools.git

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v2.0.0
2+
Rename produit_derive_lidar to las_digital_models
3+
14
# v1.2.1
25
Fix path to hydra config in Z values extraction
36

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
FROM mambaorg/micromamba:latest AS mamba_pdal
22
COPY environment.yml /environment.yml
33
USER root
4-
RUN micromamba env create -n produits_derives_lidar -f /environment.yml
4+
RUN micromamba env create -n las_digital_models -f /environment.yml
55

66

77
FROM debian:bullseye-slim
88

99
# install PDAL
10-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/bin/pdal /opt/conda/envs/produits_derives_lidar/bin/pdal
10+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/pdal /opt/conda/envs/las_digital_models/bin/pdal
1111
# install gdal
12-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/bin/*gdal* /opt/conda/envs/produits_derives_lidar/bin/
13-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/bin/python /opt/conda/envs/produits_derives_lidar/bin/python
14-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/lib/ /opt/conda/envs/produits_derives_lidar/lib/
15-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/ssl /opt/conda/envs/produits_derives_lidar/ssl
16-
COPY --from=mamba_pdal /opt/conda/envs/produits_derives_lidar/share/proj/proj.db /opt/conda/envs/produits_derives_lidar/share/proj/proj.db
12+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/*gdal* /opt/conda/envs/las_digital_models/bin/
13+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/python /opt/conda/envs/las_digital_models/bin/python
14+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/lib/ /opt/conda/envs/las_digital_models/lib/
15+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/ssl /opt/conda/envs/las_digital_models/ssl
16+
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/share/proj/proj.db /opt/conda/envs/las_digital_models/share/proj/proj.db
1717

18-
ENV PATH=$PATH:/opt/conda/envs/produits_derives_lidar/bin/
19-
ENV PROJ_LIB=/opt/conda/envs/produits_derives_lidar/share/proj/
18+
ENV PATH=$PATH:/opt/conda/envs/las_digital_models/bin/
19+
ENV PROJ_LIB=/opt/conda/envs/las_digital_models/share/proj/
2020

21-
WORKDIR /ProduitDeriveLIDAR
21+
WORKDIR /las-digital-models
2222
RUN mkdir tmp
23-
COPY produits_derives_lidar produits_derives_lidar
23+
COPY las_digital_models las_digital_models
2424
COPY test test
2525
COPY configs configs

Jenkinsfile

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)