Skip to content

Datapact demo with emulation#192

Open
aleenathomas wants to merge 84 commits intomainfrom
datapact-demo-with-emulation
Open

Datapact demo with emulation#192
aleenathomas wants to merge 84 commits intomainfrom
datapact-demo-with-emulation

Conversation

@aleenathomas
Copy link
Contributor

Main features added

  • integration with Moose API
  • added virtualization module which runs in Debian and WSL
  • edited install scripts
  • refactoring

aleenathomas and others added 30 commits January 20, 2025 13:07
- storing k3s server api and node token in a secret
- added new clusterrole and clusterrole binding for controller
- added dependencies
- added script
works:
deployment on worker node

wip:
metrics collection from worker node
works:
metrics collection from worker node

wip:
automation
 trimmed create kube node script
 tested argo workflows with output files on worker node
 removed host network true in cadvisor
 added frontend page for vmnodes
 added crd
 added get all vmnodes
wip
 create new vmnode
- added nodes section
- added node selection in create dry run modal
wip
- Edit create dry run mutation and resolver to insert new parameter
Edit argo workflows to insert the name of the vmnodes crd as node selector
-
added status in nodes crd
- Insert selected node into argo workflows automatically
@@ -0,0 +1,69 @@
{{- if .Values.postgresql.enabled -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider switching to CloudNativePG one day. Not this time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we should remove the .lock to be honest.

Comment on lines +304 to +310
resources:
requests:
memory: 512Mi
cpu: 250m
limits:
memory: 1Gi
cpu: 1000m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm usually not a fan of having this set by default because it's more annoying than useful in my opinion.

Comment on lines +360 to +365
requests:
memory: 256Mi
cpu: 250m
limits:
memory: 1Gi
cpu: 1000m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also defaults that could be left unset.

Comment on lines +339 to +372
simpipeRefreshInterval: 3s
simpipeScrapeTimeout: 2s
simpipeRefreshInterval: 7s
simpipeScrapeTimeout: 7s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those the new values that are HP compatible ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes actually these values can be changed back since we are doing virtualization (must faster) instead of emulation.

Comment on lines +84 to +86
if (osInfo.ID === 'debian') {
return 'debian13';
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced about this code snippet long term.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed.

- iptables -A INPUT -p udp --dport 8472 -j ACCEPT

# Start K3s agent only after Docker is ready
- curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.33.4+k3s1 INSTALL_K3S_EXEC="agent --docker" K3S_URL=${K3S_SERVER_URL} K3S_TOKEN=${K3S_TOKEN} sh -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are hardcoding k3s version and also installing it without ansible. I guess it's fine but we may have some mismatches long term.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the version number to a config variable for now.

- bash -c 'ip route del default via 172.30.0.1 dev lo || true'

# Start K3s agent (let k3s/flannel pick the interface/IP based on the
- curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.33.4+k3s1 INSTALL_K3S_EXEC="agent --docker" K3S_URL=${K3S_SERVER_URL} K3S_TOKEN=${K3S_TOKEN} sh -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

DNS1=$(awk '/^nameserver/{print $2; exit}' /etc/resolv.conf)
fi
if [ -z "$DNS1" ]; then
DNS1="10.43.0.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last time we were using Google DNS, and this time a local DNS resolver. Is this specific to WSL ?

Comment on lines +96 to +105
function maskSecret(value: string): string | undefined {
const trimmed = value.trim();
if (!trimmed) return undefined;
if (trimmed.length <= 4) return '*'.repeat(trimmed.length);

const prefix = trimmed.slice(0, 2);
const suffix = trimmed.slice(-2);
const maskLength = Math.min(Math.max(trimmed.length - 4, 4), 12);
return `${prefix}${'*'.repeat(maskLength)}${suffix}`;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this isn't safe.

Suggested change
function maskSecret(value: string): string | undefined {
const trimmed = value.trim();
if (!trimmed) return undefined;
if (trimmed.length <= 4) return '*'.repeat(trimmed.length);
const prefix = trimmed.slice(0, 2);
const suffix = trimmed.slice(-2);
const maskLength = Math.min(Math.max(trimmed.length - 4, 4), 12);
return `${prefix}${'*'.repeat(maskLength)}${suffix}`;
}
function maskSecret(value: string): string {
return "************";
}


return {
hasValue: true,
maskedPreview: maskSecret(trimmed),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even better:

Suggested change
maskedPreview: maskSecret(trimmed),
maskedPreview: "************"

Comment on lines +63 to +64
const processTable = await getProcessTable();
if (!processTable) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now we assume that simpipe's controller run on the qemu host, which is a significant thing in the architecture.

Comment on lines +14 to +17
wget -O /app/images/ubuntu-18.qcow2 https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img && \
wget -O /app/images/ubuntu-20.qcow2 https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img && \
wget -O /app/images/ubuntu-22.qcow2 https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img && \
wget -O /app/images/ubuntu-24.qcow2 https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That creates a huge container. Shouldn't we download that at runtime in a volume.

cloud.iso Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed :)

install.py Outdated
except subprocess.CalledProcessError as e:
print(f"❌ Error while installing helm-diff plugin: {e}")
sys.exit(1)
print("ℹ️ Skipping helm-diff plugin (not required for SIM-PIPE).")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably just remove all mention to helm diff.

meta-data Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this should stay

network-config Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one may have to go as well?

user-data Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed?

@fungiboletus
Copy link
Member

Alright, I made some comments. Overall I think it's mostly the secret thing that should be fixed. We shouldn't disclose the size of the secret nor the beginning and the end in my opinion.
Some files should be removed.

I'm not a svelte developer so I couldn't asses the frontend code very well but it did sound fair.

Overall, for the record, I'm not sure where this is going long term. We have moose now, not sure why, I have said it in person already, but this sounds like out of scope.

The project is now very much about virtualisation with qemu, which is fine. Perhaps one could have used kubevirt instead of making qemu from scratch in kubernetes, but i don't know the pros and cons.

I think someone didn't like helm diff :D

We are overall running quite old dependencies at this point, but for a low TRL demo this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants