Skip to content

Commit

Permalink
update for Equinix support
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Yuan <[email protected]>
  • Loading branch information
SamYuan1990 committed Jun 15, 2024
1 parent f867c3f commit d313290
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,24 @@ jobs:
matrix:
include:
- cluster_provider: kind
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: false
test_name: kind_libbpf
test_name: kind_basic
- cluster_provider: kind
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: false
test_name: kind_libbpf_with_prometheus
- cluster_provider: kind
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: true
test_name: kind_libbpf_with_tekton
- cluster_provider: kind
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
TEKTON_ENABLE: true
test_name: kind_libbpf_with_prometheus_and_tekton
test_name: kind_with_prometheus_and_tekton
- cluster_provider: microshift
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: false
GRAFANA_ENABLE: false
TEKTON_ENABLE: false
test_name: microshift_libbpf
- cluster_provider: microshift
ebpf_provider: libbpf
prometheus_operator_version: v0.12.0
PROMETHEUS_ENABLE: true
GRAFANA_ENABLE: true
Expand Down
23 changes: 16 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ function installXgboost(artifacts_version, xgboost_version) {
executeCommand("sudo ldconfig", "fail to ldconfig");
}

function installKubectl(kubectl_version) {
function installKubectl(kubectl_version,local_path) {
core.info(`Get kubectl with version `+ kubectl_version);
executeCommand("curl -LO https://dl.k8s.io/release/v"+kubectl_version+"/bin/linux/amd64/kubectl", "fail to install kubectl");
executeCommand("chmod +x ./kubectl");
executeCommand("mv ./kubectl /usr/local/bin/kubectl");
executeCommand("mv ./kubectl "+local_path);
core.info(`Get kustomize`);
executeCommand("curl -s \"https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh\" | bash");
executeCommand("chmod +x kustomize");
executeCommand("mv kustomize /usr/local/bin/");
executeCommand("mv kustomize "+local_path);
}

function installKind(kind_version) {
function installKind(kind_version,local_path) {
core.info(`Get Kind with latest version`);
executeCommand("curl -Lo ./kind https://kind.sigs.k8s.io/dl/v"+kind_version+"/kind-linux-amd64","fail to install kind");
executeCommand("chmod +x ./kind");
executeCommand("mv ./kind /usr/local/bin/kind");
executeCommand("mv ./kind "+local_path);
}

async function setup() {
Expand Down Expand Up @@ -91,19 +91,21 @@ async function run() {
const runningBranch = getInputOrDefault('runningBranch', '');
const ebpfprovider = getInputOrDefault('ebpfprovider', '');
const kubectl_version = getInputOrDefault('kubectl_version', '1.25.4');
const local_path = getInputOrDefault('local_path','/usr/local/bin');
// download local dev cluster
const local_dev_cluster_version = getInputOrDefault('local_dev_cluster_version', 'main');
core.info(`Get local-cluster-dev with version `+ local_dev_cluster_version);
executeCommand("git clone -b "+local_dev_cluster_version+" https://github.com/sustainable-computing-io/local-dev-cluster.git --depth=1", "fail to get local-dev-cluster");
// download kubectl and other tools
installKubectl(kubectl_version);
installKubectl(kubectl_version,local_path);
// end of prepare
try {
const artifacts_version = getInputOrDefault('artifacts_version', '0.26.0');
const xgboost_version = getInputOrDefault('xgboost_version', '');
const libbpf_version = getInputOrDefault('libbpf_version', 'v1.2.0');
const kernel_module_names = getInputOrDefault('kernel_module_names', ''); // comma delimited names, for example: rapl,intel_rapl_common
const install_containerruntime = getInputOrDefault('install_containerruntime', '');
const restartcontianerruntime = getInputOrDefault('restartcontianerruntime', '');
// base on a general workflow
// Step 1 linux header, models, extramodules, ebpf
// prerequisites
Expand All @@ -125,12 +127,19 @@ async function run() {
// Optional container runtime
if (install_containerruntime.length > 0 ) {
executeCommand(` cd local-dev-cluster && bash -c './main.sh containerruntime'`, "fail to install container runtime via local-dev-cluster")
// RESTARTCONTAINERRUNTIME
if (restartcontianerruntime.length > 0) {
executeCommand(`sudo systemctl restart docker`,"fail to docker restart")
// todo: for debug usage
// executeCommand(`journalctl -u docker`, "check docker log")
// executeCommand(`sudo systemctl status docker`,"fail to docker status")
}
}
// Step 2 k8s cluster
// run specific steps or not
if (runningBranch == 'kind' || getInputOrDefault('cluster_provider', '') == 'kind') {
const kind_version = getInputOrDefault('kind_version','0.22.0');
installKind(kind_version)
installKind(kind_version,local_path)
await setup();
}
if (runningBranch == 'microshift' || getInputOrDefault('cluster_provider', '') == 'microshift') {
Expand Down

0 comments on commit d313290

Please sign in to comment.