-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
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,55 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
BUILD_ONLY = false | ||
|
||
COMMON_CHAIN_NAME = "khala-pt3" | ||
COMMON_TAG = "21111901" | ||
|
||
DEV_NODE_DOCKER_REPO = "#{COMMON_CHAIN_NAME}-node" | ||
DEV_NODE_DOCKER_TAG = COMMON_TAG | ||
|
||
REGISTRIES = [ | ||
"jasl123", | ||
"phalanetwork", | ||
# "swr.cn-east-3.myhuaweicloud.com/phala", | ||
] | ||
|
||
require "open3" | ||
|
||
def run(cmd) | ||
Open3.popen2e(cmd) do |_stdin, stdout_err, wait_thr| | ||
while (line = stdout_err.gets) | ||
puts line | ||
end | ||
|
||
exit_status = wait_thr.value | ||
unless exit_status.success? | ||
abort "error" | ||
end | ||
end | ||
end | ||
|
||
# Build Khala-Dev-Node | ||
REGISTRIES.each do |registry| | ||
[ | ||
"docker build -f prebuilt_pt3_node.Dockerfile -t #{registry}/#{DEV_NODE_DOCKER_REPO}:#{DEV_NODE_DOCKER_TAG} .", | ||
"docker build -f prebuilt_pt3_node.Dockerfile -t #{registry}/#{DEV_NODE_DOCKER_REPO} ." | ||
].each do |cmd| | ||
puts cmd | ||
run cmd | ||
end | ||
end | ||
|
||
unless BUILD_ONLY | ||
# Push Khala-Dev-Node | ||
REGISTRIES.each do |registry| | ||
[ | ||
"docker push #{registry}/#{DEV_NODE_DOCKER_REPO}:#{DEV_NODE_DOCKER_TAG}", | ||
"docker push #{registry}/#{DEV_NODE_DOCKER_REPO}" | ||
].each do |cmd| | ||
puts cmd | ||
run cmd | ||
end | ||
end | ||
end |
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,33 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND='noninteractive' | ||
|
||
WORKDIR /root | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y apt-utils apt-transport-https software-properties-common readline-common curl vim wget gnupg gnupg2 gnupg-agent ca-certificates tini | ||
|
||
ADD prebuilt/pt3/* . | ||
|
||
ENV RUST_LOG="info" | ||
ENV NODE_NAME='khala-dev-node' | ||
ENV NODE_ROLE="MINER" | ||
|
||
ENV PARACHAIN_EXTRA_ARGS='' | ||
ENV RELAYCHAIN_EXTRA_ARGS='' | ||
|
||
ENV PARACHAIN_BOOTNODE='/dns4/pc-test-3.phala.network/tcp/30333/ws/p2p/12D3KooWNVSZMd5Hh74h8icPdkRLRP3TCkwU89AMVjZEGmvQ86pq' | ||
ENV RELAYCHAIN_BOOTNODE='/dns4/pc-test-3.phala.network/tcp/30334/ws/p2p/12D3KooWNcARLswVpKJsGK8v4krZNQQ3unbhxrZAk4YV5TX2rdos' | ||
|
||
EXPOSE 9615 | ||
EXPOSE 9933 | ||
EXPOSE 9944 | ||
EXPOSE 30333 | ||
EXPOSE 9616 | ||
EXPOSE 9934 | ||
EXPOSE 9945 | ||
EXPOSE 30334 | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
|
||
CMD ["/bin/bash", "./start_node.sh"] |