|
1 | 1 | # Geospatial Images
|
2 | 2 |
|
3 |
| -TODO |
| 3 | +## Using the Geospatial Images Data Generator in your app |
| 4 | +Using the Geospatial Images Data Generator requires the Plugin, the Plugin Config, the Data Generator container, and the Data Generator Deployment yaml. The spacefx-dev container feature can be used to automatically download and deploy these with the below configuration: |
| 5 | +```json |
| 6 | + "features": { |
| 7 | + "ghcr.io/microsoft/azure-orbital-space-sdk/spacefx-dev:0.11.0": { |
| 8 | + "app_name": "MyAwesomeApp", |
| 9 | + "download_artifacts": "GeospatialImages.proto, datagenerator-geospatial-images.yaml, geospatial-images-vth-plugin.dll, geospatial-images-vth-plugin.json.spacefx_plugin", |
| 10 | + "pull_containers": "datagenerator-geospatial-images:0.11.0-nightly" |
| 11 | + } |
| 12 | + }, |
| 13 | +``` |
| 14 | + |
| 15 | +## Geospatial Images Data Generator Source Code |
| 16 | +The Geospatial Images Data Generator comprises two components: |
| 17 | +* [Geospatial Images Data Generator](https://github.com/microsoft/azure-orbital-space-sdk-data-generators/tree/main/datagenerators/geospatial-images/datagenerator) |
| 18 | +* [Geospatial Images VTH Plugin](https://github.com/microsoft/azure-orbital-space-sdk-data-generators/tree/main/datagenerators/geospatial-images/plugin) |
| 19 | + |
| 20 | +The data generator is a Flask App that contains a repository of geospatial imagery available for querying, while the VTH Plugin is used to interact with the Flask App and download any of the geospatial images stored within the datagenerator, then send them via Link Service to the requesting Payload App. |
| 21 | + |
| 22 | +## Building the Geospatial Images Data Generator (from source) |
| 23 | +>:speech_balloon: The images, plugins, and artifacts are already built and pushed to the github container registry via our CI/CD process. These steps are a reference and **not** needed to run the Geospatial Images Data Generator. If you would like to just run the Geospatial Images Data Generator, please refer to [Geospatial Images Data Generator](https://github.com/microsoft/azure-orbital-space-sdk-data-generators/tree/main/datagenerators/geospatial-images) |
| 24 | +
|
| 25 | +1. Provision /var/spacedev |
| 26 | + ```bash |
| 27 | + # clone the azure-orbital-space-sdk-setup repo and provision /var/spacedev |
| 28 | + git clone https://github.com/microsoft/azure-orbital-space-sdk-setup |
| 29 | + cd azure-orbital-space-sdk-setup |
| 30 | + bash ./.vscode/copy_to_spacedev.sh |
| 31 | + cd - |
| 32 | + ``` |
| 33 | + |
| 34 | +2. Clone this repo |
| 35 | + ```bash |
| 36 | + # clone this repo |
| 37 | + git clone https://github.com/microsoft/azure-orbital-space-sdk-data-generators |
| 38 | +
|
| 39 | + cd azure-orbital-space-sdk-data-generators |
| 40 | + ``` |
| 41 | + |
| 42 | +3. Build and push the Geospatial Images Data Generator |
| 43 | + ```bash |
| 44 | + # Trigger the build_containerImage.sh from azure-orbital-space-sdk-setup |
| 45 | + /var/spacedev/build/build_containerImage.sh \ |
| 46 | + --architecture amd64 \ |
| 47 | + --app-name datagenerator-geospatial-images \ |
| 48 | + --image-tag 0.11.0 \ |
| 49 | + --dockerfile Dockerfiles/Dockerfile \ |
| 50 | + --repo-dir ${PWD}/datagenerators/geospatial-images/datagenerator \ |
| 51 | + --no-push \ |
| 52 | + --annotation-config azure-orbital-space-sdk-data-generators.yaml |
| 53 | + ``` |
| 54 | + >:pencil2: the `--no-push` parameter will prevent build_containerImage.sh from pushing to a container registry. We added it here to prevent accidental pushes when you copy-and-paste the command. You will need to remove the `--no-push` if you want to push the final container image to a container registry |
| 55 | + |
| 56 | +4. Build the Geospatial Images VTH Plugin |
| 57 | + ```bash |
| 58 | + # Trigger the build_app.sh from azure-orbital-space-sdk-setup |
| 59 | + /var/spacedev/build/dotnet/build_app.sh \ |
| 60 | + --architecture amd64 \ |
| 61 | + --app-project src/geospatial-images-vth-plugin.csproj \ |
| 62 | + --app-version 0.11.0 \ |
| 63 | + --output-dir /var/spacedev/tmp/geospatial-images-vth-plugin/output \ |
| 64 | + --repo-dir ${PWD} \ |
| 65 | + --devcontainer-json .devcontainer/geospatial-images-vth-plugin/devcontainer.json \ |
| 66 | + --no-container-build \ |
| 67 | + --no-push |
| 68 | + ``` |
| 69 | + >:pencil2: the `--no-container-build` parameter means that we're just interested in the build artifacts and there's not a container image for this. The `--no-push` is superflous since we aren't generating a container image, but kept it here for reference. |
| 70 | +
|
| 71 | +5. Copy the artifacts to their regular folders so it can be read by the containers |
| 72 | + ```bash |
| 73 | + # Put the dll, spacefx_config, and yaml in the destination directories |
| 74 | + sudo mkdir -p /var/spacedev/plugins/vth |
| 75 | + sudo mkdir -p /var/spacedev/yamls/deploy |
| 76 | + sudo mkdir -p /var/spacedev/protos/datagenerator/geospatial-images |
| 77 | +
|
| 78 | + sudo cp /var/spacedev/tmp/geospatial-images-vth-plugin/output/amd64/app/geospatial-images-vth-plugin.dll /var/spacedev/plugins/vth/ |
| 79 | + sudo cp /var/spacedev/tmp/geospatial-images-vth-plugin/output/amd64/app/geospatial-images-vth-plugin.json.spacefx_plugin /var/spacedev/plugins/vth/ |
| 80 | + sudo cp ${PWD}/datagenerators/geospatial-images/datagenerator/k3s/datagenerator-geospatial-images.yaml /var/spacedev/yamls/deploy/ |
| 81 | + sudo cp ${PWD}/datagenerators/geospatial-images/plugin/src/Protos/GeospatialImages.proto /var/spacedev/protos/datagenerator/geospatial-images/ |
| 82 | + ``` |
| 83 | +
|
| 84 | +6. (Optional) Push the build artifacts to the container registry |
| 85 | + >:heavy_exclamation_mark: the next step will push the build artifacts to the first container registry you have write access to, including our automated channel tagging and patching aliases. Do not run this step unless you intend to deploy the artifacts to a container registry for others to consume. |
| 86 | + ```bash |
| 87 | + /var/spacedev/build/push_build_artifact.sh --artifact /var/spacedev/plugins/vth/geospatial-images-vth-plugin.dll --annotation-config azure-orbital-space-sdk-data-generators.yaml --architecture amd64 --artifact-version 0.11.0 |
| 88 | + /var/spacedev/build/push_build_artifact.sh --artifact /var/spacedev/plugins/vth/geospatial-images-vth-plugin.json.spacefx_plugin --annotation-config azure-orbital-space-sdk-data-generators.yaml --architecture amd64 --artifact-version 0.11.0 |
| 89 | + /var/spacedev/build/push_build_artifact.sh --artifact /var/spacedev/yamls/deploy/datagenerator-geospatial-images.yaml --annotation-config azure-orbital-space-sdk-data-generators.yaml --architecture amd64 --artifact-version 0.11.0 |
| 90 | + /var/spacedev/build/push_build_artifact.sh --artifact /var/spacedev/protos/datagenerator/geospatial-images/GeospatialImages.proto --annotation-config azure-orbital-space-sdk-data-generators.yaml --architecture amd64 --artifact-version 0.11.0 |
| 91 | + ``` |
| 92 | +
|
| 93 | +
|
0 commit comments