Skip to content

Commit 42c628b

Browse files
authored
Merge pull request #14 from microsoft/al/geospatial-images-vth-plugin
Al/geospatial images vth plugin
2 parents fcb6f51 + cb63737 commit 42c628b

24 files changed

+1675
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
{
4+
"name": "geospatial-images-vth-plugin",
5+
"image": "mcr.microsoft.com/devcontainers/dotnet:0-6.0",
6+
"runArgs": [
7+
"--name=geospatial-images-vth-plugin"
8+
],
9+
"workspaceFolder": "/workspace/geospatial-images-vth-plugin",
10+
"workspaceMount": "source=${localWorkspaceFolder}/datagenerators/geospatial-images/plugin,target=/workspace/geospatial-images-vth-plugin,type=bind,consistency=cached",
11+
"features": {
12+
"ghcr.io/microsoft/azure-orbital-space-sdk/spacefx-dev:0.11.0": {
13+
"app_name": "geospatial-images-vth-plugin",
14+
"app_type": "vth-plugin",
15+
"addl_debug_shim_suffixes": "client",
16+
"pull_containers": "datagenerator-geospatial-images:0.11.0-nightly",
17+
"download_artifacts": "datagenerator-geospatial-images.yaml"
18+
}
19+
},
20+
"mounts": [
21+
"source=${localWorkspaceFolder}/datagenerators/geospatial-images/datagenerator,target=/workspace/geospatial-images-vth-datagenerator,type=bind,consistency=cached"
22+
],
23+
"hostRequirements": {
24+
"cpus": 8,
25+
"memory": "8gb"
26+
},
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"ms-dotnettools.csharp",
31+
"ms-dotnettools.csdevkit",
32+
"DavidAnson.vscode-markdownlint",
33+
"zxh404.vscode-proto3",
34+
"mutantdino.resourcemonitor",
35+
"josefpihrt-vscode.roslynator",
36+
"bierner.markdown-mermaid"
37+
]
38+
},
39+
// Grant permissions to the Azure Orbital Space SDK repositories and their packages
40+
"codespaces": {
41+
"repositories": {
42+
"microsoft/azure-orbital-space-sdk": {
43+
"permissions": {
44+
"contents": "read",
45+
"packages": "read"
46+
}
47+
},
48+
"microsoft/azure-orbital-space-sdk-core": {
49+
"permissions": {
50+
"contents": "read",
51+
"packages": "read"
52+
}
53+
},
54+
"microsoft/azure-orbital-space-sdk-setup": {
55+
"permissions": {
56+
"contents": "read",
57+
"packages": "read"
58+
}
59+
},
60+
"microsoft/azure-orbital-space-sdk-coresvc-registry": {
61+
"permissions": {
62+
"contents": "read",
63+
"packages": "read"
64+
}
65+
},
66+
"microsoft/azure-orbital-space-sdk-coresvc-fileserver": {
67+
"permissions": {
68+
"contents": "read",
69+
"packages": "read"
70+
}
71+
},
72+
"microsoft/azure-orbital-space-sdk-coresvc-switchboard": {
73+
"permissions": {
74+
"contents": "read",
75+
"packages": "read"
76+
}
77+
},
78+
"microsoft/azure-orbital-space-sdk-platform-mts": {
79+
"permissions": {
80+
"contents": "read",
81+
"packages": "read"
82+
}
83+
},
84+
"microsoft/azure-orbital-space-sdk-platform-deployment": {
85+
"permissions": {
86+
"contents": "read",
87+
"packages": "read"
88+
}
89+
},
90+
"microsoft/azure-orbital-space-sdk-vth": {
91+
"permissions": {
92+
"contents": "read",
93+
"packages": "read"
94+
}
95+
},
96+
"microsoft/azure-orbital-space-sdk-hostsvc-link": {
97+
"permissions": {
98+
"contents": "read",
99+
"packages": "read"
100+
}
101+
},
102+
"microsoft/azure-orbital-space-sdk-hostsvc-logging": {
103+
"permissions": {
104+
"contents": "read",
105+
"packages": "read"
106+
}
107+
},
108+
"microsoft/azure-orbital-space-sdk-hostsvc-position": {
109+
"permissions": {
110+
"contents": "read",
111+
"packages": "read"
112+
}
113+
},
114+
"microsoft/azure-orbital-space-sdk-hostsvc-sensor": {
115+
"permissions": {
116+
"contents": "read",
117+
"packages": "read"
118+
}
119+
}
120+
}
121+
}
122+
},
123+
"remoteUser": "root"
124+
}

.github/workflows/geospatial-images-generator-build.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
YAML_FOLDER_PATH: ./datagenerators/geospatial-images/datagenerator/k3s
2929
YAML_FILE_NAME: datagenerator-geospatial-images.yaml
3030
secrets:
31-
GIT_HUB_USER_NAME: ${{ secrets.GIT_HUB_USER_NAME }}
32-
GIT_HUB_USER_TOKEN: ${{ secrets.GIT_HUB_USER_TOKEN }}
31+
GIT_HUB_USER_NAME: ${{ secrets.TEMP_GITHUB_USERNAME }}
32+
GIT_HUB_USER_TOKEN: ${{ secrets.TEMP_WORKFLOW_TOKEN }}
3333
SETUP_REPO_URL: ${{ secrets.SETUP_REPO_URL }}
3434

3535
build-datagenerator-geospatial-images-arm64:
@@ -50,6 +50,6 @@ jobs:
5050
YAML_FOLDER_PATH: ./datagenerators/geospatial-images/datagenerator/k3s
5151
YAML_FILE_NAME: datagenerator-geospatial-images.yaml
5252
secrets:
53-
GIT_HUB_USER_NAME: ${{ secrets.GIT_HUB_USER_NAME }}
54-
GIT_HUB_USER_TOKEN: ${{ secrets.GIT_HUB_USER_TOKEN }}
53+
GIT_HUB_USER_NAME: ${{ secrets.TEMP_GITHUB_USERNAME }}
54+
GIT_HUB_USER_TOKEN: ${{ secrets.TEMP_WORKFLOW_TOKEN }}
5555
SETUP_REPO_URL: ${{ secrets.SETUP_REPO_URL }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: geospatial-images-plugin-build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'datagenerators/geospatial-images/plugin/**'
10+
- '.github/workflows/geospatial-images-plugin-build.yaml'
11+
12+
jobs:
13+
build-plugin-geospatial-images-amd64:
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
uses: microsoft/azure-orbital-space-sdk-github-actions/.github/workflows/plugin-build.yaml@main
19+
with:
20+
APP_PROJECT: ./src/geospatial-images-vth-plugin.csproj
21+
OUTPUT_DIR: /var/spacedev/tmp/geospatial-images-vth-plugin/output
22+
PLUGIN_STAGING_DIRECTORY: /var/spacedev/plugins/vth
23+
PLUGIN_FILE_NAME: geospatial-images-vth-plugin.dll
24+
PLUGIN_CONFIG_FILE_NAME: geospatial-images-vth-plugin.json.spacefx_plugin
25+
ANNOTATION: azure-orbital-space-sdk-data-generators.yaml
26+
WORKFLOW_AGENT: ubuntu-latest
27+
ARCHITECTURE: amd64
28+
DEV_CONTAINER_JSON: .devcontainer/geospatial-images-vth-plugin/devcontainer.json
29+
PROTO_STAGING_DIRECTORY: /var/spacedev/protos/datagenerator/geospatial-images
30+
PROTO_FOLDER_PATH: ./datagenerators/geospatial-images/plugin/src/Protos
31+
PROTO_FILE_NAME: GeospatialImages.proto
32+
secrets:
33+
GIT_HUB_USER_NAME: ${{ secrets.TEMP_GITHUB_USERNAME }}
34+
GIT_HUB_USER_TOKEN: ${{ secrets.TEMP_WORKFLOW_TOKEN }}
35+
SETUP_REPO_URL: ${{ secrets.SETUP_REPO_URL }}
36+
37+
build-plugin-geospatial-images-arm64:
38+
permissions:
39+
contents: read
40+
packages: write
41+
42+
uses: microsoft/azure-orbital-space-sdk-github-actions/.github/workflows/plugin-build.yaml@main
43+
with:
44+
APP_PROJECT: ./src/geospatial-images-vth-plugin.csproj
45+
OUTPUT_DIR: /var/spacedev/tmp/geospatial-images-vth-plugin/output
46+
PLUGIN_STAGING_DIRECTORY: /var/spacedev/plugins/vth
47+
PLUGIN_FILE_NAME: geospatial-images-vth-plugin.dll
48+
PLUGIN_CONFIG_FILE_NAME: geospatial-images-vth-plugin.json.spacefx_plugin
49+
ANNOTATION: azure-orbital-space-sdk-data-generators.yaml
50+
WORKFLOW_AGENT: spacesdk-ubuntu-2204LTS-arm64
51+
ARCHITECTURE: arm64
52+
DEV_CONTAINER_JSON: .devcontainer/geospatial-images-vth-plugin/devcontainer.json
53+
PROTO_STAGING_DIRECTORY: /var/spacedev/protos/datagenerator/geospatial-images
54+
PROTO_FOLDER_PATH: ./datagenerators/geospatial-images/plugin/src/Protos
55+
PROTO_FILE_NAME: GeospatialImages.proto
56+
secrets:
57+
GIT_HUB_USER_NAME: ${{ secrets.TEMP_GITHUB_USERNAME }}
58+
GIT_HUB_USER_TOKEN: ${{ secrets.TEMP_WORKFLOW_TOKEN }}
59+
SETUP_REPO_URL: ${{ secrets.SETUP_REPO_URL }}
+91-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,93 @@
11
# Geospatial Images
22

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

Comments
 (0)