Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra report file op, disable snap builds #1708

Merged
merged 4 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions .github/workflows/publish-docker-and-wsl.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Docker and WSL Images

on:
push:
branches:
- master
tags:
- v*

jobs:
build:
runs-on: self-hosted
timeout-minutes: 2880
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
config-inline: |
[worker.oci]
max-parallelism = 1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Use the repository information of the checked-out code to format docker tags
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: opendronemap/odm
tag-semver: |
{{version}}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
file: ./portable.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: |
${{ steps.docker_meta.outputs.tags }}
opendronemap/odm:latest
# Trigger NodeODM build
- name: Dispatch NodeODM Build Event
id: nodeodm_dispatch
run: |
curl -X POST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/OpenDroneMap/NodeODM/actions/workflows/publish-docker.yaml/dispatches --data '{"ref": "master"}'
98 changes: 49 additions & 49 deletions .github/workflows/publish-snap.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
name: Publish Snap
# name: Publish Snap

on:
push:
branches:
- master
tags:
- v**
# on:
# push:
# branches:
# - master
# tags:
# - v**

jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
- amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
- name: Build
id: build
uses: diddlesnaps/snapcraft-multiarch-action@v1
with:
architecture: ${{ matrix.architecture }}
- name: Publish unstable builds to Edge
if: github.ref == 'refs/heads/master'
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: edge
- name: Publish tagged prerelease builds to Beta
# These are identified by having a hyphen in the tag name, e.g.: v1.0.0-beta1
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: beta
- name: Publish tagged stable or release-candidate builds to Candidate
# These are identified by NOT having a hyphen in the tag name, OR having "-RC" or "-rc" in the tag name.
if: startsWith(github.ref, 'refs/tags/v1') && ( ( ! contains(github.ref, '-') ) || contains(github.ref, '-RC') || contains(github.ref, '-rc') )
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: candidate
# jobs:
# build-and-release:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# architecture:
# - amd64
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set Swap Space
# uses: pierotofy/set-swap-space@master
# with:
# swap-size-gb: 12
# - name: Build
# id: build
# uses: diddlesnaps/snapcraft-multiarch-action@v1
# with:
# architecture: ${{ matrix.architecture }}
# - name: Publish unstable builds to Edge
# if: github.ref == 'refs/heads/master'
# uses: snapcore/action-publish@v1
# with:
# store_login: ${{ secrets.STORE_LOGIN }}
# snap: ${{ steps.build.outputs.snap }}
# release: edge
# - name: Publish tagged prerelease builds to Beta
# # These are identified by having a hyphen in the tag name, e.g.: v1.0.0-beta1
# if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')
# uses: snapcore/action-publish@v1
# with:
# store_login: ${{ secrets.STORE_LOGIN }}
# snap: ${{ steps.build.outputs.snap }}
# release: beta
# - name: Publish tagged stable or release-candidate builds to Candidate
# # These are identified by NOT having a hyphen in the tag name, OR having "-RC" or "-rc" in the tag name.
# if: startsWith(github.ref, 'refs/tags/v1') && ( ( ! contains(github.ref, '-') ) || contains(github.ref, '-RC') || contains(github.ref, '-rc') )
# uses: snapcore/action-publish@v1
# with:
# store_login: ${{ secrets.STORE_LOGIN }}
# snap: ${{ steps.build.outputs.snap }}
# release: candidate
70 changes: 0 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,6 @@ ODM can be installed natively on Windows. Just download the latest setup from th
run C:\Users\youruser\datasets\project [--additional --parameters --here]
```

## Snap Package

ODM is now available as a Snap Package from the Snap Store. To install you may use the Snap Store (available itself as a Snap Package) or the command line:

```bash
sudo snap install --edge opendronemap
```

To run, you will need a terminal window into which you can type:

```bash
opendronemap

# or

snap run opendronemap

# or

/snap/bin/opendronemap
```

Snap packages will be kept up-to-date automatically, so you don't need to update ODM manually.

## GPU Acceleration

ODM has support for doing SIFT feature extraction on a GPU, which is about 2x faster than the CPU on a typical consumer laptop. To use this feature, you need to use the `opendronemap/odm:gpu` docker image instead of `opendronemap/odm` and you need to pass the `--gpus all` flag:
Expand Down Expand Up @@ -147,52 +123,6 @@ You're in good shape!

See https://github.com/NVIDIA/nvidia-docker and https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker for information on docker/NVIDIA setup.

## WSL or WSL2 Install

Note: This requires that you have installed WSL already by following [the instructions on Microsoft's Website](https://docs.microsoft.com/en-us/windows/wsl/install-win10).

You can run ODM via WSL or WSL2 by downloading the `rootfs.tar.gz` file from [the releases page on GitHub](https://github.com/OpenDroneMap/ODM/releases). Once you have the file saved to your `Downloads` folder in Windows, open a PowerShell or CMD window by right-clicking the Flag Menu (bottom left by default) and selecting "Windows PowerShell", or alternatively by using the [Windows Terminal from the Windows Store](https://www.microsoft.com/store/productId/9N0DX20HK701).

Inside a PowerShell window, or Windows Terminal running PowerShell, type the following:

```powershell
# PowerShell
wsl.exe --import ODM $env:APPDATA\ODM C:\path\to\your\Downloads\rootfs.tar.gz
```

Alternatively if you're using `CMD.exe` or the `CMD` support in Windows Terminal type:

```cmd
# CMD
wsl.exe --import ODM %APPDATA%\ODM C:\path\to\your\Downloads\rootfs.tar.gz
```

In either case, make sure you replace `C:\path\to\your\Downloads\rootfs.tar.gz` with the actual path to your `rootfs.tar.gz` file.

This will save a new Hard Disk image to your Windows `AppData` folder at `C:\Users\username\AppData\roaming\ODM` (where `username` is your Username in Windows), and will set-up a new WSL "distro" called `ODM`.

You may start the ODM distro by using the relevant option in the Windows Terminal (from the Windows Store) or by executing `wsl.exe -d ODM` in a PowerShell or CMD window.

ODM is installed to the distro's `/code` directory. You may execute it with:

```bash
/code/run.sh
```

### Updating ODM in WSL

The easiest way to update the installation of ODM is to download the new `rootfs.tar.gz` file and import it as another distro. You may then unregister the original instance the same way you delete ODM from WSL (see next heading).

### Deleting an ODM in WSL instance

```cmd
wsl.exe --unregister ODM
```

Finally you'll want to delete the files by using your Windows File Manager (Explorer) to navigate to `%APPDATA%`, find the `ODM` directory, and delete it by dragging it to the recycle bin. To permanently delete it empty the recycle bin.

If you have installed to a different directory by changing the `--import` command you ran to install you must use that directory name to delete the correct files. This is likely the case if you have multiple ODM installations or are updating an already-installed installation.

## Native Install (Ubuntu 21.04)

You can run ODM natively on Ubuntu 21.04 (although we don't recommend it):
Expand Down
2 changes: 2 additions & 0 deletions opendm/osfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ def export_report(self, report_path, odm_stats, rerun=False):
pdf_report.save_report("report.pdf")

if os.path.exists(osfm_report_path):
if os.path.exists(report_path):
os.unlink(report_path)
shutil.move(osfm_report_path, report_path)
else:
log.ODM_WARNING("Report could not be generated")
Expand Down