diff --git a/packages/orchestrator/pkg/template/build/phases/base/distro/distro.go b/packages/orchestrator/pkg/template/build/phases/base/distro/distro.go index c1b47c0cb2..6a6c2d322b 100644 --- a/packages/orchestrator/pkg/template/build/phases/base/distro/distro.go +++ b/packages/orchestrator/pkg/template/build/phases/base/distro/distro.go @@ -101,6 +101,26 @@ var Profiles = []Profile{ // link the bundle envd's ExecStartPre expects to the extracted PEM. CARefresh: `update-ca-trust extract && ln -sf /etc/pki/tls/certs/ca-bundle.crt "$E2B_CA_BUNDLE"`, }, + { + // TencentOS Server, OpenCloudOS and OpenCloudOS Stream + Key: "tencentos", + Init: InitSystemd, + IDs: []string{"tencentos", "opencloudos"}, + Packages: []string{ + "systemd", "shadow-utils", "passwd", "openssh-server", "sudo", "chrony", + "socat", "curl", "ca-certificates", "fuse3", "iptables", "git", + "nfs-utils", "less", "nftables", "iputils", "jq", "bash", "tar", + "iproute", "findutils", + }, + PkgQueryBody: `rpm -q "$1" >/dev/null 2>&1`, + PkgInstall: `dnf -y install --allowerasing "$@"`, + InitBinary: "/usr/lib/systemd/systemd", + TimeSyncUnit: "chronyd", + SSHUnit: "sshd", + AdminGroup: "wheel", + CABundle: "/etc/ssl/certs/ca-certificates.crt", + CARefresh: `update-ca-trust extract && ln -sf /etc/pki/tls/certs/ca-bundle.crt "$E2B_CA_BUNDLE"`, + }, { Key: "arch", Init: InitSystemd, diff --git a/packages/orchestrator/pkg/template/build/phases/base/distro/parity_test.go b/packages/orchestrator/pkg/template/build/phases/base/distro/parity_test.go index 04c0c4a2e6..42238e65ae 100644 --- a/packages/orchestrator/pkg/template/build/phases/base/distro/parity_test.go +++ b/packages/orchestrator/pkg/template/build/phases/base/distro/parity_test.go @@ -19,110 +19,127 @@ var capabilities = []struct { byFamily map[string][]string }{ {"init", map[string][]string{ - "debian": {"systemd", "systemd-sysv"}, - "rhel": {"systemd"}, - "arch": {"systemd"}, - "alpine": {"openrc"}, + "debian": {"systemd", "systemd-sysv"}, + "rhel": {"systemd"}, + "tencentos": {"systemd"}, + "arch": {"systemd"}, + "alpine": {"openrc"}, }}, {"shell", map[string][]string{ // bash is Essential on Debian and Ubuntu. - "debian": {}, - "rhel": {"bash"}, - "arch": {"bash"}, - "alpine": {"bash"}, + "debian": {}, + "rhel": {"bash"}, + "tencentos": {"bash"}, + "arch": {"bash"}, + "alpine": {"bash"}, }}, {"shadow-tools", map[string][]string{ // passwd (useradd/usermod) is priority required on Debian and Ubuntu. - "debian": {}, - "rhel": {"shadow-utils", "passwd"}, - "arch": {"shadow"}, - "alpine": {"shadow"}, + "debian": {}, + "rhel": {"shadow-utils", "passwd"}, + "tencentos": {"shadow-utils", "passwd"}, + "arch": {"shadow"}, + "alpine": {"shadow"}, }}, {"ssh-server", map[string][]string{ - "debian": {"openssh-server"}, - "rhel": {"openssh-server"}, - "arch": {"openssh"}, - "alpine": {"openssh"}, + "debian": {"openssh-server"}, + "rhel": {"openssh-server"}, + "tencentos": {"openssh-server"}, + "arch": {"openssh"}, + "alpine": {"openssh"}, }}, {"sudo", map[string][]string{ - "debian": {"sudo"}, - "rhel": {"sudo"}, - "arch": {"sudo"}, - "alpine": {"sudo"}, + "debian": {"sudo"}, + "rhel": {"sudo"}, + "tencentos": {"sudo"}, + "arch": {"sudo"}, + "alpine": {"sudo"}, }}, {"time-sync", map[string][]string{ - "debian": {"chrony"}, - "rhel": {"chrony"}, - "arch": {"chrony"}, - "alpine": {"chrony"}, + "debian": {"chrony"}, + "rhel": {"chrony"}, + "tencentos": {"chrony"}, + "arch": {"chrony"}, + "alpine": {"chrony"}, }}, {"ca-certificates", map[string][]string{ - "debian": {"ca-certificates"}, - "rhel": {"ca-certificates"}, - "arch": {"ca-certificates"}, - "alpine": {"ca-certificates"}, + "debian": {"ca-certificates"}, + "rhel": {"ca-certificates"}, + "tencentos": {"ca-certificates"}, + "arch": {"ca-certificates"}, + "alpine": {"ca-certificates"}, }}, {"fuse", map[string][]string{ - "debian": {"fuse3"}, - "rhel": {"fuse3"}, - "arch": {"fuse3"}, - "alpine": {"fuse3"}, + "debian": {"fuse3"}, + "rhel": {"fuse3"}, + "tencentos": {"fuse3"}, + "arch": {"fuse3"}, + "alpine": {"fuse3"}, }}, {"nfs-client", map[string][]string{ - "debian": {"nfs-common"}, - "rhel": {"nfs-utils"}, - "arch": {"nfs-utils"}, - "alpine": {"nfs-utils"}, + "debian": {"nfs-common"}, + "rhel": {"nfs-utils"}, + "tencentos": {"nfs-utils"}, + "arch": {"nfs-utils"}, + "alpine": {"nfs-utils"}, }}, {"packet-filter", map[string][]string{ - "debian": {"iptables", "nftables"}, - "rhel": {"iptables", "nftables"}, - "arch": {"iptables", "nftables"}, - "alpine": {"iptables", "nftables"}, + "debian": {"iptables", "nftables"}, + "rhel": {"iptables", "nftables"}, + "tencentos": {"iptables", "nftables"}, + "arch": {"iptables", "nftables"}, + "alpine": {"iptables", "nftables"}, }}, {"git", map[string][]string{ - "debian": {"git"}, - "rhel": {"git"}, - "arch": {"git"}, - "alpine": {"git"}, + "debian": {"git"}, + "rhel": {"git"}, + "tencentos": {"git"}, + "arch": {"git"}, + "alpine": {"git"}, }}, {"jq", map[string][]string{ - "debian": {"jq"}, - "rhel": {"jq"}, - "arch": {"jq"}, - "alpine": {"jq"}, + "debian": {"jq"}, + "rhel": {"jq"}, + "tencentos": {"jq"}, + "arch": {"jq"}, + "alpine": {"jq"}, }}, {"socat", map[string][]string{ - "debian": {"socat"}, - "rhel": {"socat"}, - "arch": {"socat"}, - "alpine": {"socat"}, + "debian": {"socat"}, + "rhel": {"socat"}, + "tencentos": {"socat"}, + "arch": {"socat"}, + "alpine": {"socat"}, }}, {"curl", map[string][]string{ - "debian": {"curl"}, - "rhel": {"curl"}, - "arch": {"curl"}, - "alpine": {"curl"}, + "debian": {"curl"}, + "rhel": {"curl"}, + "tencentos": {"curl"}, + "arch": {"curl"}, + "alpine": {"curl"}, }}, {"pager", map[string][]string{ - "debian": {"less"}, - "rhel": {"less"}, - "arch": {"less"}, - "alpine": {"less"}, + "debian": {"less"}, + "rhel": {"less"}, + "tencentos": {"less"}, + "arch": {"less"}, + "alpine": {"less"}, }}, {"ping", map[string][]string{ - "debian": {"iputils-ping"}, - "rhel": {"iputils"}, - "arch": {"iputils"}, - "alpine": {"iputils"}, + "debian": {"iputils-ping"}, + "rhel": {"iputils"}, + "tencentos": {"iputils"}, + "arch": {"iputils"}, + "alpine": {"iputils"}, }}, {"socket-stats", map[string][]string{ // ss — Debian and RHEL slim images omit it, busybox ships netstat but // not ss; Arch's base metapackage already depends on iproute2. - "debian": {"iproute2"}, - "rhel": {"iproute"}, - "arch": {}, - "alpine": {"iproute2"}, + "debian": {"iproute2"}, + "rhel": {"iproute"}, + "tencentos": {"iproute"}, + "arch": {}, + "alpine": {"iproute2"}, }}, {"find", map[string][]string{ // The finalize configuration script walks /etc/skel with find(1) when @@ -131,26 +148,29 @@ var capabilities = []struct { // dependency of Arch's base metapackage; busybox ships a find applet // with the -mindepth/-type/-print0 predicates the script uses. Only // the RPM family's minimal images (Rocky/Alma/UBI-style) omit it. - "debian": {}, - "rhel": {"findutils"}, - "arch": {}, - "alpine": {}, + "debian": {}, + "rhel": {"findutils"}, + "tencentos": {"findutils"}, + "arch": {}, + "alpine": {}, }}, {"archiver", map[string][]string{ // Only the RPM family needs tar declared: yum-era CentOS 7 doesn't ship // it, while Debian, Arch and busybox all provide tar in the base image. - "debian": {}, - "rhel": {"tar"}, - "arch": {}, - "alpine": {}, + "debian": {}, + "rhel": {"tar"}, + "tencentos": {"tar"}, + "arch": {}, + "alpine": {}, }}, {"io-priority", map[string][]string{ // ionice comes with util-linux everywhere except Alpine, where busybox // omits it and envd needs it to reset user processes off realtime IO. - "debian": {}, - "rhel": {}, - "arch": {}, - "alpine": {"util-linux-misc"}, + "debian": {}, + "rhel": {}, + "tencentos": {}, + "arch": {}, + "alpine": {"util-linux-misc"}, }}, }