Skip to content

Commit

Permalink
Code amendments for arm devices
Browse files Browse the repository at this point in the history
Signed-off-by: Zou Yulin <[email protected]>
  • Loading branch information
yulinzou authored and lrq619 committed Apr 15, 2024
1 parent 41785cd commit cc52682
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
### Added

- Added support for [`OpenYurt`](https://openyurt.io/), an open platform that extends upstream Kubernetes to run on edge node pools. More details on how to the `Knative-atop-OpenYurt` mode are described [here](scripts/openyurt-deployer/README.md).
- Added support for arm64 ubuntu 18.04 in stock-only setup with [setup scripts](./scripts/setup.go).


### Changed

- Removed the utils and examples from the vHive repo, moved to [vSwarm](https://github.com/vhive-serverless/vSwarm).
- Bumped Go to 1.21, Kubernetes to v1.29, Knative to v1.13, Istio to 1.20.2, MetalLB to 0.14.3, Calico to 3.27.2.
- Bumped Go to 1.21, Kubernetes to v1.29, Knative to v1.13, Istio to 1.20.2, MetalLB to 0.14.3, Calico to 3.27.3.
- Made the automatic patching of the knative-serving and calico manifests instead of storing the patched manifests in the repo.

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion configs/registry/repository-update-hosts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
echo "Done."
containers:
- name: init-container-did-the-work
image: gcr.io/google_containers/pause-amd64:3.1@sha256:59eec8837a4d942cc19a52b8c09ea75121acc38114a2c68b98983ce9356b8610
image: registry.k8s.io/pause:3.6
terminationGracePeriodSeconds: 30
volumes:
- name: etchosts
Expand Down
2 changes: 1 addition & 1 deletion configs/setup/kube.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ApiserverPort": "6443",
"ApiserverToken": "",
"ApiserverTokenHash": "",
"CalicoVersion": "3.27.2"
"CalicoVersion": "3.27.3"
}
2 changes: 1 addition & 1 deletion configs/setup/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"KubeRepoUrl": "https://pkgs.k8s.io/core:/stable:/v1.29/deb/",
"PmuToolsRepoUrl": "https://github.com/vhive-serverless/pmu-tools",
"ProtocVersion": "3.19.4",
"ProtocDownloadUrlTemplate": "https://github.com/protocolbuffers/protobuf/releases/download/v%s/protoc-%s-linux-x86_64.zip",
"ProtocDownloadUrlTemplate": "https://github.com/protocolbuffers/protobuf/releases/download/v%s/protoc-%s-linux-%s.zip",
"LogVerbosity": 0,
"YQDownloadUrlTemplate": "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_%s"
}
2 changes: 1 addition & 1 deletion docs/quickstart_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To see how to setup a single node cluster with stock-only or gVisor, see [Develo
## I. Host platform requirements
### 1. Hardware
1. Two x64 servers in the same network.
- We have not tried vHive with Arm but it may not be hard to port because Firecracker supports Arm64 ISA.
- vHive is now compatible with arm64 Ubuntu 18.04 servers for multi-node clusters using the `stock-only` setting. Other configurations and OS versions have not been tested at this time.
2. Hardware support for virtualization and KVM.
- Nested virtualization is supported provided that KVM is available.
3. The root partition of the host filesystem should be mounted on an **SSD**. That is critical for snapshot-based cold-starts.
Expand Down
12 changes: 11 additions & 1 deletion scripts/configs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ var System = SystemEnvironmentStruct{
}

func (system *SystemEnvironmentStruct) GetProtocDownloadUrl() string {
return fmt.Sprintf(system.ProtocDownloadUrlTemplate, system.ProtocVersion, system.ProtocVersion)
unameArch := system.CurrentArch
switch unameArch {
case "amd64":
unameArch = "x86_64"
case "arm64":
unameArch = "aarch_64"
default:
}
return fmt.Sprintf(system.ProtocDownloadUrlTemplate, system.ProtocVersion, system.ProtocVersion, unameArch)
}

func (system *SystemEnvironmentStruct) GetContainerdDownloadUrl() string {
Expand All @@ -80,6 +88,8 @@ func (system *SystemEnvironmentStruct) GetRunscDownloadUrl() string {
switch unameArch {
case "amd64":
unameArch = "x86_64"
case "arm64":
unameArch = "aarch_64"
default:
}

Expand Down
3 changes: 3 additions & 0 deletions scripts/install_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ case $arch in
'x86_64')
arch='amd64'
;;
'aarch64')
arch='arm64'
;;
*)
echo "Unsupported architecture $arch"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func ExecShellCmd(cmd string, pars ...any) (string, error) {
// Detect current architecture
func DetectArch() error {
switch configs.System.CurrentArch {
case "amd64":
case "amd64", "arm64":
default:
// Only amd64(x86_64) are supported at present
// amd64(x86_64) and arm64(aarch64) are supported at present
FatalPrintf("Unsupported architecture: %s\n", configs.System.CurrentArch)
return &ShellError{"Unsupported architecture", 1}
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ func TurnOffAutomaticUpgrade() error {
}

func InstallYQ() {
InfoPrintf("Downloading yq for yaml parsing of template")
WaitPrintf("Downloading yq for yaml parsing of template")
yqUrl := fmt.Sprintf(configs.System.YqDownloadUrlTemplate, configs.System.CurrentArch)
_, err := ExecShellCmd(`sudo wget %s -O /usr/bin/yq && sudo chmod +x /usr/bin/yq`, yqUrl)
CheckErrorWithMsg(err, "Failed to add yq!\n")
CheckErrorWithTagAndMsg(err, "Failed to add yq!\n")
}

0 comments on commit cc52682

Please sign in to comment.