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

Network update and GIVC TLS #915

Merged
merged 3 commits into from
Feb 4, 2025
Merged

Network update and GIVC TLS #915

merged 3 commits into from
Feb 4, 2025

Conversation

mbssrc
Copy link
Collaborator

@mbssrc mbssrc commented Nov 25, 2024

Description of changes

This patch re-works the networking and enables TLS for GIVC.

Updates

  • update flake inputs: givc, ctrl-panel

Usage of nixos-rebuild requires a proxy jump. This can be done by

  • adding a proxy-jump ssh configuration to your dev machine, such as
programs = {
  ssh = {
    startAgent = true;
    extraConfig = ''
      host ghaf-netvm
        user root
        hostname <target-ip>
      host ghaf-host
         user root
         hostname 192.168.100.2
         proxyjump ghaf-netvm
    '';
  };
};
  • export the NIX_SSHOPTS environment variable before using nixos-rebuild:
    export NIX_SSHOPTS="-o ProxyJump=root@<your-target-ip>"

  • using the new helper in the Ghaf devshell ghaf-rebuild that does it for you.
    Usage: ghaf-rebuild [regular nixos-rebuild options]
    Example: ghaf-rebuild 192.168.0.123 .#lenovo-x1-carbon-gen11-debug switch

This applies to all targets.

Exceptions:
Connecting to the host directly is possible in the following cases:
- AGX if connected via physical ethernet port
- X1 and AGX/NX if net-vm is stopped (ethernet dongle should then be attached to the host)

Changes to networking

  • auto-generate IP and MAC addresses
  • remove 'debug' network from ghaf. We can later remove
    the host from network in release and facilitate communication
    over mem share and/or vsock

Note that

  • the ghaf-host-debug name no longer exists
  • all VMs + host run in 192.168.100.0 subnet
    - you may need to change your proxy jumps to adjust for the changed ghaf-host address (192.168.100.2)
  • all VMs are reachable through their host name

Changes to givc

  • enable tls
  • enable multiple admin service interfaces
  • centralize givc-cli arguments across ghaf

Checklist for things done

  • Summary of the proposed changes in the PR description
  • More detailed description in the commit message(s)
  • Commits are squashed into relevant entities - avoid a lot of minimal dev time commits in the PR
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • PR linked to architecture documentation and requirement(s) (ticket id)
  • Test procedure described (or includes tests). Select one or more:
    • Tested on Lenovo X1 x86_64
    • Tested on Jetson Orin NX or AGX aarch64
    • Tested on Polarfire riscv64
  • Author has run make-checks and it passes
  • All automatic Github Action checks pass - see actions
  • Author has added reviewers and removed PR draft status
  • Change requires full re-installation
  • Change can be updated with nixos-rebuild ... switch

Instructions for Testing

  • List all targets that this applies to: Lenovo X1
  • Is this a new feature
    • System boots
    • GIVC certificates are available everywhere in "/etc/givc" and "/run/givc" in gui-vm
    • Test that all apps + functionality works as before
    • Test that all VMs and host are reachable in the network
    • Regression testing for nvidia targets
  • If it is an improvement how does it impact existing functionality?

@mbssrc mbssrc temporarily deployed to internal-build-workflow November 25, 2024 10:09 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow November 25, 2024 10:50 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow January 11, 2025 19:16 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow January 11, 2025 19:31 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow January 11, 2025 19:36 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow January 11, 2025 20:09 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow January 12, 2025 10:10 — with GitHub Actions Inactive
@mbssrc mbssrc changed the title WIP: GIVC TLS Network update and GIVC TLS Jan 12, 2025
@mbssrc mbssrc requested a review from brianmcgillion January 13, 2025 07:04
@mbssrc mbssrc mentioned this pull request Jan 16, 2025
15 tasks
modules/common/common.nix Outdated Show resolved Hide resolved
modules/common/common.nix Outdated Show resolved Hide resolved
modules/givc/common.nix Show resolved Hide resolved
modules/givc/common.nix Outdated Show resolved Hide resolved
@mbssrc
Copy link
Collaborator Author

mbssrc commented Jan 23, 2025

39b4699 Updates:

  • rebase to latest
  • address review comments
  • change the way keys/certificates are packaged. Now they are stored in /storagevm/givc folder as images, so they can be mounted read-only into VMs. This allows to preserve "stateless" VMs such as zathura.
  • move the host folder generation to no be guarded by unsafe shares

@brianmcgillion brianmcgillion added the Needs Testing CI Team to pre-verify label Jan 28, 2025
@johannarautanen
Copy link

johannarautanen commented Feb 3, 2025

Checked with native Orin AGX:

Working:

  • you can sign in to Element if you activate the wifi in Orin AGX(net-vm)
  • and when you stop the net-vm via ghaf-host, you can sign to Element via physical ethernet or USB-ethernet adapter connection. And after that you can also connect ghaf-host from remote laptop.
  • can only connect with net-vm or ghaf-host. net-vm-debug or ghaf-host-debug are not working anymore
  • IP's 192.168.100.1 and 192.168.100.2 working. OId IP's not working anymore (192.168.101.1 or 192.168.101.2)
  • all 4 application can be launched

@johannarautanen johannarautanen added the bug on Orin AGX Issues found on NVIDIA Jetson AGX Orin while checking this PR label Feb 3, 2025
@johannarautanen
Copy link

johannarautanen commented Feb 3, 2025

Checked with native Orin NX:

  • When attached the ethernet to the physical port (net-vm) the Ghaf time updated.
  • can sign to the element-app
  • and when the net-vm is closed via ghaf-host, you can sign to the Element when USB-ethernet adapter (ghaf-host) is used.
  • can only connect with net-vm or ghaf-host. net-vm-debug or ghaf-host-debug are not working anymore
  • IP's 192.168.100.1 and 192.168.100.2 working. OId IP's not working anymore (192.168.101.1 or 192.168.101.2)
  • all 4 application can be launched

@johannarautanen johannarautanen added Tested on Orin AGX This PR has been tested on NVIDIA Jetson AGX Orin Tested on Orin NX This PR has been tested on NVIDIA Jetson NX Orin and removed bug on Orin AGX Issues found on NVIDIA Jetson AGX Orin while checking this PR labels Feb 3, 2025
@milva-unikie
Copy link

Tested on Lenovo-X1 (full re-installation)

New issues:

  • VPN does not work any more. I am able to connect to VPN with the app but can't access jira.tii.ae in Trusted Browser.

Previous issues have been fixed:

  • Host clock is now synchronized.
  • Logs are sent to Grafana.

Notes:

  • I confirmed that the boot issue I reported earlier is not related to this pr.
  • Test-automation fix has been updated to the latest changes. Most of the bat-tests pass on X1, but many still need more reworking. Orins have not yet been tested. Update network connections ci-test-automation#222

@milva-unikie milva-unikie added bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR and removed Needs Testing CI Team to pre-verify labels Feb 3, 2025
@mbssrc
Copy link
Collaborator Author

mbssrc commented Feb 3, 2025

Tested on Lenovo-X1 (full re-installation)

New issues:

* VPN does not work any more. I am able to connect to VPN with the app but can't access jira.tii.ae in Trusted Browser.

Cannot reproduce the VPN error on my side. Also can't think of a reason how it could be affected. Please check again.

@mbssrc mbssrc temporarily deployed to internal-build-workflow February 3, 2025 18:18 — with GitHub Actions Inactive
@milva-unikie
Copy link

Cannot reproduce the VPN error on my side. Also can't think of a reason how it could be affected. Please check again.

tldr: works now

It definitely was not working yesterday or this morning. I re-installed and still nothing. And then suddenly it started working and has now worked for an hour. After it started working I tried again to re-install and this time it worked right away. No idea what happened but should be good now. Sorry about the confusion.

@milva-unikie milva-unikie added Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon and removed bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR labels Feb 4, 2025
@mbssrc mbssrc temporarily deployed to internal-build-workflow February 4, 2025 11:01 — with GitHub Actions Inactive
Updates:
- update flake inputs: givc, ctrl-panel

Changes to networking:
- auto-generate IP and MAC addresses
- remove 'debug' network from ghaf. Next step we can remove
  the host from network and facilitate communication
  over mem share or vsock in release

Changes to givc:
- enable tls
- enable multiple admin service interfaces
- centralize givc-cli arguments across ghaf

Signed-off-by: Manuel Bluhm <[email protected]>
- fix logging server address
- add vhotplug to nvidia devices
- add devshell helper script for builds

Signed-off-by: Manuel Bluhm <[email protected]>
Change addressing scheme of nw-packet-fowarder

Signed-off-by: Manuel Bluhm <[email protected]>
@brianmcgillion brianmcgillion merged commit 45c34cd into tiiuae:main Feb 4, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon Tested on Orin AGX This PR has been tested on NVIDIA Jetson AGX Orin Tested on Orin NX This PR has been tested on NVIDIA Jetson NX Orin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants