-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52ca0fb
commit b23aaab
Showing
16 changed files
with
454 additions
and
61 deletions.
There are no files selected for viewing
250 changes: 203 additions & 47 deletions
250
...erverless_lib/core/src/main/java/io/serverless_lib/process_rpc_proto/ProcessRpcProto.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz | ||
WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz | ||
WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz.1 | ||
llvm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
### chdir | ||
import os | ||
import sys | ||
import yaml | ||
import zipfile | ||
|
||
CUR_FPATH = os.path.abspath(__file__) | ||
CUR_FDIR = os.path.dirname(CUR_FPATH) | ||
# chdir to the directory of this script | ||
os.chdir(CUR_FDIR) | ||
|
||
# os.system('ansible-playbook -vv 2.ans_install_build.yml -i ../local_ansible_conf.ini') | ||
### utils | ||
def os_system_sure(command): | ||
print(f">>> Run:{command}") | ||
result = os.system(command) | ||
if result != 0: | ||
print(f">>> Fail:{command}\n\n") | ||
exit(1) | ||
print(f">>> Succ:{command}\n\n") | ||
|
||
|
||
# result.returncode | ||
# result.stdout | ||
def run_cmd_return(cmd): | ||
print(f"Run:{cmd}") | ||
result = subprocess.run(command, shell=True, capture_output=True, text=True) | ||
print(f"Stdout:{result.stdout}\n\n") | ||
return result | ||
|
||
|
||
def print_title(title): | ||
print(f"\n\n>>> {title}") | ||
################################################################################################# | ||
|
||
os_system_sure("python3 inner/install_maven.py") | ||
|
||
CRAC_INSTALL_DIR = "/usr/jdk_crac" | ||
if not os.path.exists(CRAC_INSTALL_DIR): | ||
os_system_sure("python3 inner/install_crac.py") | ||
|
||
os_system_sure("python3 inner/switch_jdk_17crac.py") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz | ||
WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz | ||
apache-maven-3.9.6-bin.tar.gz | ||
apache-maven-3.9.6 | ||
crac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|
||
### chdir | ||
import os | ||
CUR_FPATH = os.path.abspath(__file__) | ||
CUR_FDIR = os.path.dirname(CUR_FPATH) | ||
# chdir to the directory of this script | ||
os.chdir(CUR_FDIR) | ||
|
||
|
||
### utils | ||
def os_system_sure(command): | ||
print(f"执行命令:{command}") | ||
result = os.system(command) | ||
if result != 0: | ||
print(f"命令执行失败:{command}") | ||
exit(1) | ||
print(f"命令执行成功:{command}") | ||
|
||
|
||
CRAC_INSTALL_DIR = "/usr/jdk_crac" | ||
|
||
|
||
|
||
def compile_crac(): | ||
os_system_sure("apt install build-essential autoconf openjdk-17-jdk -y") | ||
os.system("git clone https://github.com/ActivePeter/crac") | ||
os.chdir("crac") | ||
os_system_sure("git checkout sofacrac17") | ||
installs=[ | ||
'libfontconfig1-dev', | ||
'libx11-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev', | ||
'zip unzip', | ||
'file', | ||
'build-essential', | ||
'libasound2-dev', | ||
'libcups2-dev' | ||
] | ||
|
||
os_system_sure("apt update") | ||
os_system_sure("apt install {} -y".format(" ".join(installs))) | ||
|
||
bins=[ | ||
"java", | ||
"javac", | ||
"jcmd" | ||
] | ||
OPENJDK="/usr/lib/jvm/java-17-openjdk-amd64/" | ||
# swicth back to openjdk | ||
for bin in bins: | ||
# os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {OPENJDK}bin/{bin} 1") | ||
os_system_sure(f"update-alternatives --set {bin} {OPENJDK}bin/{bin}") | ||
|
||
os_system_sure("bash configure") | ||
os_system_sure("make images") | ||
CRIU_PATH = "build/linux-x86_64-server-release/images/jdk/lib/criu" | ||
if not os.path.exists(CRIU_PATH): | ||
os_system_sure("wget https://github.com/CRaC/criu/releases/download/release-crac/criu-dist.tar.gz") | ||
os_system_sure("tar -zxvf criu-dist.tar.gz") | ||
os_system_sure(f"cp criu-dist/sbin/criu {CRIU_PATH}") | ||
|
||
os_system_sure("rm -rf {}".format(CRAC_INSTALL_DIR)) | ||
os_system_sure(f"cp -r build/linux-x86_64-server-release/images/jdk/ {CRAC_INSTALL_DIR}") | ||
# switch to crac jdk | ||
|
||
for bin in bins: | ||
os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {CRAC_INSTALL_DIR}/bin/{bin} 100") | ||
os_system_sure(f"update-alternatives --set {bin} {CRAC_INSTALL_DIR}/bin/{bin}") | ||
|
||
|
||
|
||
|
||
def download_crac_bin(): | ||
if not os.path.exists("./bellsoft-jdk17.0.10+14-linux-amd64-crac.deb"): | ||
os_system_sure("wget https://download.bell-sw.com/java/17.0.10+14/bellsoft-jdk17.0.10+14-linux-amd64-crac.deb") | ||
|
||
os_system_sure("dpkg -i bellsoft-jdk17.0.10+14-linux-amd64-crac.deb") | ||
|
||
compile_crac() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
### chdir | ||
import os | ||
CUR_FPATH = os.path.abspath(__file__) | ||
CUR_FDIR = os.path.dirname(CUR_FPATH) | ||
# chdir to the directory of this script | ||
os.chdir(CUR_FDIR) | ||
|
||
|
||
### utils | ||
def os_system_sure(command): | ||
print(f"执行命令:{command}") | ||
result = os.system(command) | ||
if result != 0: | ||
print(f"命令执行失败:{command}") | ||
exit(1) | ||
print(f"命令执行成功:{command}") | ||
|
||
|
||
|
||
if os.path.exists("apache-maven-3.9.6-bin.tar.gz"): | ||
print("maven已存在,无需再次下载") | ||
else: | ||
os_system_sure("wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz") | ||
|
||
|
||
|
||
if os.path.exists("apache-maven-3.9.6"): | ||
print("maven已解压,无需再次解压") | ||
else: | ||
os_system_sure("tar -zxvf apache-maven-3.9.6-bin.tar.gz") | ||
|
||
|
||
|
||
MAVEN="/usr/lib/mvn" | ||
os_system_sure("mkdir -p "+MAVEN) | ||
os_system_sure("cp -r apache-maven-3.9.6 "+MAVEN) | ||
|
||
|
||
|
||
bins=[ | ||
"mvn", | ||
"mvnDebug", | ||
"mvnyjp", | ||
] | ||
|
||
|
||
|
||
for bin in bins: | ||
os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {MAVEN}/apache-maven-3.9.6/bin/{bin} 1") | ||
os_system_sure(f"update-alternatives --set {bin} {MAVEN}/apache-maven-3.9.6/bin/{bin}") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
### chdir | ||
import os | ||
CUR_FPATH = os.path.abspath(__file__) | ||
CUR_FDIR = os.path.dirname(CUR_FPATH) | ||
# chdir to the directory of this script | ||
os.chdir(CUR_FDIR) | ||
|
||
|
||
### utils | ||
def os_system_sure(command): | ||
print(f"执行命令:{command}") | ||
result = os.system(command) | ||
if result != 0: | ||
print(f"命令执行失败:{command}") | ||
exit(1) | ||
print(f"命令执行成功:{command}") | ||
|
||
|
||
CRAC_INSTALL_DIR = "/usr/jdk_crac" | ||
|
||
|
||
bins=[ | ||
"java", | ||
"javac", | ||
"jcmd" | ||
] | ||
# swicth back to openjdk | ||
for bin in bins: | ||
os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {CRAC_INSTALL_DIR}/bin/{bin} 100") | ||
os_system_sure(f"update-alternatives --set {bin} {CRAC_INSTALL_DIR}/bin/{bin}") | ||
|
||
|
||
|
||
|
||
# Check and update JAVA_HOME in /etc/environment | ||
with open("/root/.bashrc", "r") as env_file: | ||
lines = env_file.readlines() | ||
|
||
java_home_set = False | ||
for line in lines: | ||
if line.startswith("export JAVA_HOME="): | ||
line=f"export JAVA_HOME={CRAC_INSTALL_DIR}\n" | ||
java_home_set = True | ||
if not java_home_set: | ||
lines.append(f"export JAVA_HOME={CRAC_INSTALL_DIR}\n") | ||
print("env lines: ",lines) | ||
|
||
with open("/root/.bashrc", "w") as env_file: | ||
env_file.writelines(lines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters