Skip to content

Commit

Permalink
add pt3 relates
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Dec 10, 2021
1 parent b9a89b8 commit 77d23f2
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
55 changes: 55 additions & 0 deletions build_and_push_pt3.rb
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
33 changes: 33 additions & 0 deletions prebuilt_pt3_node.Dockerfile
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"]

0 comments on commit 77d23f2

Please sign in to comment.