Skip to content

Commit

Permalink
Merge pull request #51 from IGNF/dev
Browse files Browse the repository at this point in the history
Version 1.7.0
  • Loading branch information
leavauchier authored Jul 16, 2024
2 parents 61e895e + add0ff2 commit 1b3dc28
Show file tree
Hide file tree
Showing 11 changed files with 468 additions and 90 deletions.
68 changes: 38 additions & 30 deletions .github/workflows/cicd_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,81 @@ on:
# Also run when the pull request merges (which generates a push)
# So that we can tag the docker image appropriately.
push:
branches:
- master
branches: [ "master" ]
tags: [ 'v*.*.*' ]

env:
DOCKER_REPO: ignimagelidar/ign-pdal-tools
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
TEST_TAG: ${{ github.repository }}:test

jobs:
deploy_docker:
runs-on: ubuntu-latest

permissions:
packages: write

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v2
- name: Build the Docker image
id: build
uses: docker/build-push-action@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ${{ env.DOCKER_REPO }}:test
tags: ${{ env.TEST_TAG }}

- name: Set version number
run: |
echo "VERSION=$(docker run ${{ env.DOCKER_REPO }}:test python -m pdaltools._version)" >> $GITHUB_ENV
- name: Run pytest
# run the test on the docker image
- name: Run tests in docker image
run: >
docker run
--ipc=host
${{ env.DOCKER_REPO }}:test
${{ env.TEST_TAG }}
python -m pytest ./test -s --log-cli-level DEBUG
-
name: Build and push
uses: docker/build-push-action@v4
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build an Docker image with Buildx (don't on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.DOCKER_REPO }}:latest,${{ env.DOCKER_REPO }}:${{ env.VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy-pypi:
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/ign-pdal-tools

permissions:
contents: read
packages: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing


steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4

# See https://github.com/marketplace/actions/setup-micromamba
- name: setup-micromamba
uses: mamba-org/setup-micromamba@v1.4.3
uses: mamba-org/setup-micromamba@v1.9.0
with:
micromamba-version: '1.5.8-0' # temporary fix as setup-mircomamba hangs with later mamba version
environment-file: environment.yml
environment-name: pdaltools # activate the environment
cache-environment: true
Expand Down
43 changes: 17 additions & 26 deletions .github/workflows/cicd_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,36 @@ on:
- dev

env:
DOCKER_REPO: ignimagelidar/ign-pdal-tools
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
TEST_TAG: ${{ github.repository }}:test

jobs:
test_docker:
deploy_docker:
runs-on: ubuntu-latest

permissions:
packages: write

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v2
- name: Build the Docker image
id: build
uses: docker/build-push-action@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ${{ env.DOCKER_REPO }}:test

- name: Set version number
run: |
echo "VERSION=$(docker run ${{ env.DOCKER_REPO }}:test python -m pdaltools._version)" >> $GITHUB_ENV
tags: ${{ env.TEST_TAG }}

- name: Run pytest
# run the test on the docker image
- name: Run tests in docker image
run: >
docker run
--ipc=host
${{ env.DOCKER_REPO }}:test
${{ env.TEST_TAG }}
python -m pytest ./test -s --log-cli-level DEBUG
test_local:
runs-on: ubuntu-latest
environment:
Expand All @@ -59,17 +51,16 @@ jobs:
permissions:
contents: read
packages: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing


steps:
- name: Checkout branch
uses: actions/checkout@v3

# See https://github.com/marketplace/actions/setup-micromamba
- name: setup-micromamba
uses: mamba-org/setup-micromamba@v1.4.3
uses: mamba-org/setup-micromamba@v1.9.0
with:
micromamba-version: '1.5.8-0' # temporary fix as setup-mircomamba hangs with later mamba version
environment-file: environment.yml
environment-name: pdaltools # activate the environment
cache-environment: true
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cicd_light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4

# See https://github.com/marketplace/actions/setup-micromamba
- name: setup-micromamba
uses: mamba-org/setup-micromamba@v1.4.3
uses: mamba-org/setup-micromamba@v1.9.0
with:
micromamba-version: '1.5.8-0' # temporary fix as setup-mircomamba hangs with later mamba version
environment-file: environment.yml
environment-name: pdaltools # activate the environment
cache-environment: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ tmp
__pycache__
ign_pdal_tools.egg-info
dist
*.idea*
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.7.0
- las_remove_dimension: new tool to remove one or many dimensions
- deploy on ghcr.io instead of dockerhub
- Add tools to run functions on buffered las:
- update create_las_with_buffer to enable saving which points are from the central las on a new dimension
- add a remove_points_from_buffer to remove the points that have this new dimension not set to 1
- add a decorator to run a function on a buffered las and return an output las only with the points from the original input

# 1.6.0
- color: choose streams for RGB colorization, and IRC colorization (doc https://geoservices.ign.fr/services-web-experts-ortho)
- color: detect white images.
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,21 @@ clean:
# Build/deploy Docker image
##############################

PROJECT_NAME=ignimagelidar/ign-pdal-tools
REGISTRY=ghcr.io
NAMESPACE=ignf
IMAGE_NAME=ign-pdal-tools
VERSION=`python -m pdaltools._version`
FULL_IMAGE_NAME=${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:${VERSION}

docker-build: clean
docker build --no-cache -t ${PROJECT_NAME}:${VERSION} -f Dockerfile .
docker build --no-cache -t ${IMAGE_NAME}:${VERSION} -f Dockerfile .

docker-test:
docker run --rm -it ${PROJECT_NAME}:${VERSION} python -m pytest -s
docker run --rm -it ${IMAGE_NAME}:${VERSION} python -m pytest -s

docker-remove:
docker rmi -f `docker images | grep ${PROJECT_NAME} | tr -s ' ' | cut -d ' ' -f 3`
docker rmi -f `docker images | grep ${IMAGE_NAME}:${VERSION} | tr -s ' ' | cut -d ' ' -f 3`

docker-deploy:
docker push ${PROJECT_NAME}:${VERSION}
docker tag ${IMAGE_NAME}:${VERSION} ${FULL_IMAGE_NAME}
docker push ${FULL_IMAGE_NAME}
2 changes: 1 addition & 1 deletion pdaltools/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.6.0"
__version__ = "1.7.0"


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit 1b3dc28

Please sign in to comment.