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

Update worldmap (webmap) version #129

Merged
merged 81 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
fa26617
update --check logic and nodered version compatibility
phreed May 14, 2024
74a2fe1
ignore apt so files and merge error files
phreed Oct 8, 2024
6b01b86
enabled devcontainer
phreed Oct 8, 2024
eb73b15
use more current version of nodejs
phreed Oct 8, 2024
00735d9
invoke the nodejs environment function
phreed Oct 8, 2024
b457749
Update example-compose ui definition
RadioAndrea Mar 7, 2024
56ad582
Added volume version of yaml file
RadioAndrea Mar 24, 2024
2c2982c
Updated readme documentation
RadioAndrea Mar 24, 2024
e5fa925
Docker: Add env vars to compose files
stephendade Apr 25, 2024
5bb989b
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
e449d23
Docker: Add env vars to compose files
stephendade Apr 25, 2024
d79b711
Docker: Add env vars to compose files
stephendade Apr 25, 2024
f7597ae
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
79a592c
Docker: Add env vars to compose files
stephendade Apr 25, 2024
be09151
Docker: Add env vars to compose files
stephendade Apr 25, 2024
63c2619
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
f5438b5
Docker: Add env vars to compose files
stephendade Apr 25, 2024
c282e5f
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
d9015d7
Docker: Add env vars to compose files
stephendade Apr 25, 2024
cbfca2d
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
55d3007
Docker: Add env vars to compose files
stephendade Apr 25, 2024
122bb37
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
d490e14
Docker: Add env vars to compose files
stephendade Apr 25, 2024
05eeb0e
Docker: Add env vars to compose files
stephendade Apr 25, 2024
a8e637f
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
0fc4657
Docker: Add env vars to compose files
stephendade Apr 25, 2024
679acf8
Docker: Add env vars to compose files
stephendade Apr 25, 2024
b60c23b
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
f488123
update --check logic and nodered version compatibility
phreed May 14, 2024
25b5071
ignore apt so files and merge error files
phreed Oct 8, 2024
26fc64e
enabled devcontainer
phreed Oct 8, 2024
e0bcee7
use more current version of nodejs
phreed Oct 8, 2024
0ec2063
invoke the nodejs environment function
phreed Oct 8, 2024
2104692
Docker: Add env vars to compose files
stephendade Apr 25, 2024
d43fdde
Docker: Add env vars to compose files
stephendade Apr 25, 2024
4667ddd
Docker: Add env vars to compose files
stephendade Apr 25, 2024
a0503bb
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
2670825
Docker: Add env vars to compose files
stephendade Apr 25, 2024
45b3657
Docker: Add env vars to compose files
stephendade Apr 25, 2024
5af1711
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
1c53e68
Docker: Add env vars to compose files
stephendade Apr 25, 2024
29f629c
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
7edd977
Docker: Add env vars to compose files
stephendade Apr 25, 2024
9af9c0e
Docker: Add env vars to compose files
stephendade Apr 25, 2024
13b5313
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
1b6299e
Docker: Add env vars to compose files
stephendade Apr 25, 2024
2cd46eb
Docker: Add env vars to compose files
stephendade Apr 25, 2024
416fd89
Update compose files so that containers can find each other
RadioAndrea Sep 1, 2024
3fc76da
Merge remote-tracking branch 'refs/remotes/origin/issue_120' into iss…
phreed Oct 8, 2024
1a83783
match upstream main
phreed Oct 8, 2024
ae47604
make clean up less aggresive
phreed Oct 8, 2024
42a9078
released version of webmap
phreed Oct 8, 2024
ff5c070
quiet the bash trace
phreed Oct 8, 2024
4e792e9
update testing instructions
phreed Oct 8, 2024
77a941e
use pyvenv rather than installing the virtualenv package
phreed Oct 8, 2024
bbb2f9e
virtualevn install
phreed Oct 8, 2024
7dc7c83
install virtualenv via pip
phreed Oct 8, 2024
3f5a1e2
use venv module
phreed Oct 8, 2024
6d21d87
must install venv with python3-venv
phreed Oct 8, 2024
2fc1490
python environment not installing properly
phreed Oct 8, 2024
6f52672
move ansible into the python venv
phreed Oct 8, 2024
66e27d8
echo command line args
phreed Oct 8, 2024
43ad138
the easy_install.sh needs a branch specifier
phreed Oct 8, 2024
ba07c1d
use the ansible python interpreter to install venv
phreed Oct 8, 2024
c506c82
use ansible python to set venv python
phreed Oct 8, 2024
2bbb5a9
missed quotes on venv python variable
phreed Oct 8, 2024
e3f9682
not picking up correct python
phreed Oct 8, 2024
87a5579
save ansible.cfg
phreed Oct 9, 2024
fd64b89
removed local versions of certain flows
phreed Oct 11, 2024
0de79d7
removed personal paths
phreed Oct 11, 2024
9243d51
update flow sources, include global-config flow (environment variables)
phreed Oct 17, 2024
bedeeb8
update the documentation with environment variables
phreed Oct 17, 2024
92b527c
log_verbosity needs a default value, given 0
phreed Oct 17, 2024
271d982
ansible gather_timeout needs a default value, given 10 (seconds)
phreed Oct 17, 2024
28e7dec
provide default remote_port, given as 22
phreed Oct 17, 2024
c6d6648
suppress ignore_signature_status_codes
phreed Oct 17, 2024
5268557
park ansible.cfg until later
phreed Oct 17, 2024
7e563ca
park ansible.cfg until later
phreed Oct 17, 2024
d0aaee5
temporarily do not update global-config
phreed Oct 17, 2024
3f6ed37
waiting for new videochecker flow
phreed Oct 17, 2024
9acba63
do not stop processing just because a flow could not be set
phreed Oct 18, 2024
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
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
RUN apt-get update \
&& apt-get install -y python3 python3-pip \
&& pip3 install --upgrade pip virtualenv
51 changes: 51 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json.
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "FTS-Install",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile",
"context": "."
},

// Features to add to the dev container. ore info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
"customizations" : {
"jetbrains" : {
"backend" : "IntelliJ"
}
},
"runArgs": [
"--net", "host",
"-e", "DISPLAY=:0",
"-e", "XAUTHORITY=/tmp/.Xauthority",
"-v", "${localEnv:HOME}/.Xauthority:/tmp/.Xauthority"
],
"containerEnv": {
"DISPLAY": "unix:0"
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ terraform.rc

# ansible
ansible_log.rb
ansible.cfg

/.vagrant/bundler/global.sol
/.vagrant/machines/default/digital_ocean/action_provision
/.vagrant/machines/default/digital_ocean/creator_uid
Expand All @@ -72,3 +72,9 @@ ansible.cfg
/.vagrant/*
/.byebug_history
/docs/DEV.md

apt_inst.so
apt_pkg.so

git-error-*

980 changes: 980 additions & 0 deletions ansible.cfg

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions docs/ubuntu-test-container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Testing FTS Zero Touch Installer on Ubuntu

Obviously, the ZTI can be tested in a clean native Ubuntu environment.
However, setting up such an environment can consume time.
So, while in a production environment, running FTS on dedicated hardware is the correct choice,
in a test environment it is more appropriate to use a container.

## Setting up the container

The test container can be constructed with any number of technologies.

[Distrobox](https://wiki.archlinux.org/title/Distrobox)
[Ptyrix](https://flathub.org/apps/app.devsuite.Ptyxis)
[Boxbuddy](https://flathub.org/apps/io.github.dvlv.boxbuddyrs)

We will want to specify a specific Ubuntu version we want `v22.04`.
```shell
distrobox create --image ubuntu:22.04 --name fts-test-install --yes \
--init --additional-packages "systemd libpam-systemd pipewire-audio-client-libraries"
```

Enter the container
```shell
distrobox enter --name fts-test-install
```

## Use Zero Touch Intallation (ZTI)

Note: The following steps may be modified to accommodate your situation.

### The Working Repository

The project working directory is mounted into the distrobox.
The following is an example:
```bash
cd ./Projects/fts-install
export MY_WD=$(pwd)
```

Your test will probably need the locally known IP address.
You may change the configured IP address later,
but it is easiest to handle it now.
It is likely you will want the host interface the example here instead uses `docker0`.
```bash
export MY_IPA=$(ip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
```

You opened a branch for your issue.
```bash
export MY_BRANCH=issue_118
```

```bash
echo "My IPA: ${MY_IPA}, WD: ${MY_WD}, ISSUE: ${MY_BRANCH}"
```

Install FTS using the candidate ZTI.
The `--verbose` is optional.

#### Use a Committed Branch from a Git Repository
Notice that in the following command the `easy_install.sh` is taken from
a working tree, while the branch is from the committed repository.

```bash
sudo bash ${MY_WD}/scripts/easy_install.sh -- \
--verbose --repo file://${MY_WD}/.git \
--branch ${MY_BRANCH:-main} \
--ip-addr ${MY_IPA}
```
If you want to use Python packages from the https://test.pypi.org repository.
```bash
cat ${MY_WD}/scripts/easy_install.sh | \
sudo bash -s -- --verbose \
--repo file://${MY_WD}/.git \
--branch ${MY_BRANCH:-main} \
--ip-addr ${MY_IPA} \
--pypi https://test.pypi.org
```

### Configuration

The official configuration instructions are
[available in the user guide](https://freetakteam.github.io/FreeTAKServer-User-Docs/Installation/Operation/).
Those instructions will not be duplicated here.

## Running Installation Tests (smoke test)

[Smoke testing](https://en.wikipedia.org/wiki/Smoke_testing_(software))
is performed with the installation validation instructions.
The official installation validation instructions are
[available in the user guide](https://freetakteam.github.io/FreeTAKServer-User-Docs/Installation/Troubleshooting/InstallationCheck/).
Those instructions will not be duplicated here.

## Resetting the `distrobox`

### Hard Reset
The distrobox can be deleted and recreated.

```shell
distrobox rm fts
```

### Soft Reset

The soft reset creates a new distrobox from a previous box.
(You did make a snapshot, right?)
```shell
distrobox create --clone fts --name fts-test
```
File renamed without changes.
21 changes: 18 additions & 3 deletions docs/ubuntu_rasppi_test.md → docs/ubuntu-test-rasppi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,28 @@ to get the `easy_install.sh` from the same repository and branch as the ZTI.

The official GitHub is `FreeTAKTeam`,
if you are working in a fork you will need to use that.

```bash
export MY_IP=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
export MY_IPA=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
export MY_GITHUB=babeloff
export MY_BRANCH=issue_120
echo "github: ${MY_GITHUB}, branch: ${MY_BRANCH}, addr: ${MY_IPA}"
```

The environment variables default values:
```bash
export MY_IPA=127.0.0.1
export MY_GITHUB=FreeTAKTeam
````
export MY_BRANCH=main
```

```bash
wget -qO - https://raw.githubusercontent.com/${MY_GITHUB}/FreeTAKHub-Installation/main/scripts/easy_install.sh | sudo bash -s -- --verbose --repo https://github.com/${MY_GITHUB}/FreeTAKHub-Installation.git --branch main --ip-addr ${MY_IP}
wget -qO - https://raw.githubusercontent.com/${MY_GITHUB:-FreeTAKTeam}/FreeTAKHub-Installation/${MY_BRANCH:-main}/scripts/easy_install.sh | \
sudo bash -s -- \
--verbose \
--repo https://github.com/${MY_GITHUB:-FreeTAKTeam}/FreeTAKHub-Installation.git \
--branch ${MY_BRANCH:-main} \
--ip-addr ${MY_IPA:-127.0.0.1}
```


Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
- name: cleanup /tmp/*
shell: sudo rm -rf /tmp/*
- name: cleanup temp files created by ansible
ansible.builtin.file:
path: /tmp/ansible*
state: absent
4 changes: 4 additions & 0 deletions roles/common/vars/Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
---
unit_files_location: /etc/systemd/system

# venv_python: "{{ ansible_python_interpreter }}"

venv_python: "python"
3 changes: 2 additions & 1 deletion roles/freetakserver/tasks/setup-Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# - "pip install /FreeTakServer"

- name: "Install {{ fts_pip_package_name }}"
pip:
ansible.builtin.pip:
name: "{{ fts_pip_package_name }}=={{ fts_version }}"
virtualenv: "{{ fts_venv }}"
virtualenv_command: "{{ venv_python }} -m venv"
3 changes: 2 additions & 1 deletion roles/freetakserver/tasks/uninstall-Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
state: absent

- name: Uninstall
pip:
ansible.builtin.pip:
name: "{{ fts_pip_package_name }}"
state: absent
virtualenv: "{{ fts_venv }}"
virtualenv_command: "{{ venv_python }} -m venv"

- name: Remove files
file:
Expand Down
6 changes: 4 additions & 2 deletions roles/freetakserver_ui/tasks/setup-Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
name: "{{ fts_ui_apt_packages }}"

- name: "Install pip packages"
pip:
ansible.builtin.pip:
name: "{{ fts_ui_pip_packages }}"
virtualenv: "{{ fts_venv }}"
virtualenv_command: "{{ venv_python }} -m venv"

- name: "Install {{ fts_ui_pip_package_name }}"
pip:
ansible.builtin.pip:
name: "{{ fts_ui_pip_package_name }}"
virtualenv: "{{ fts_venv }}"
virtualenv_command: "{{ venv_python }} -m venv"
3 changes: 2 additions & 1 deletion roles/freetakserver_ui/tasks/uninstall-Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
state: absent

- name: Uninstall
pip:
ansible.builtin.pip:
name: "{{ fts_ui_pip_package_name }}"
state: absent
virtualenv: "{{ fts_venv }}"
virtualenv_command: "{{ venv_python }} -m venv"
16 changes: 6 additions & 10 deletions roles/nodered/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,23 @@ noderedserver_ipv4: 0.0.0.0
noderedserver_port: 1880

nodered_npm_packages:
- node-red@v2-maintenance
- node-red@v3.1.9
- node-red-admin
- node-red-contrib-web-worldmap
- node-red-contrib-web-worldmap@5.0.3
- node-red-contrib-tak-registration@0.12.1

nodered_nodes:
- node-red-contrib-config
- node-red-dashboard
- node-red-contrib-credentials

# Moved to their own repository : these are backups
nodered_flows:
- salute.json
- videochecker.json
- webmap.json

nodered_post_flows_body: "{{ lookup('template', 'flows.json.j2') }}"

nodered_post_flow_salute: "{{ lookup('template', 'salute.json.j2') }}"
nodered_global_config_flow: "{{ lookup('template', 'global-config.json.j2') }}"

nodered_post_flow_videochecker: "{{ lookup('template', 'videochecker.json.j2') }}"

nodered_post_flow_webmap: "{{ lookup('template', 'webmap.json.j2') }}"
nodered_post_flows_body: "{{ lookup('template', 'flows.json.j2') }}"

nodered_service_name: nodered

Expand Down
Loading
Loading