-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bake_remotely' into midlbaker
- Loading branch information
Showing
15 changed files
with
584 additions
and
167 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
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,33 @@ | ||
set -ex | ||
|
||
TEZ_VAR=/var/tezos | ||
TEZ_BIN=/usr/local/bin | ||
CLIENT_DIR="$TEZ_VAR/client" | ||
NODE_DIR="$TEZ_VAR/node" | ||
BAKER_EXTRA_ARGS_FROM_ENV=${BAKER_EXTRA_ARGS} | ||
mkdir -p $CLIENT_DIR | ||
|
||
per_block_vote_file=/etc/tezos/baker-config/${BAKER_NAME}-${PROTO_COMMAND}-per-block-votes.json | ||
|
||
if [ ! -f "$per_block_vote_file" ]; then | ||
echo "Error: $per_block_vote_file not found" >&2 | ||
exit 1 | ||
fi | ||
|
||
extra_args="--votefile ${per_block_vote_file}" | ||
|
||
if [ "${OPERATIONS_POOL}" != "" ]; then | ||
extra_args="${extra_args} --operations-pool ${OPERATIONS_POOL}" | ||
fi | ||
|
||
if [ "${DAL_NODE_RPC_URL}" != "" ]; then | ||
extra_args="${extra_args} --dal-node ${DAL_NODE_RPC_URL}" | ||
fi | ||
|
||
CLIENT="$TEZ_BIN/octez-client -d $CLIENT_DIR" | ||
CMD="$TEZ_BIN/octez-baker-${PROTO_COMMAND} -d $CLIENT_DIR" | ||
|
||
# ensure we can run octez-client commands without specifying client dir | ||
ln -s /var/tezos/client /home/tezos/.tezos-client | ||
|
||
exec $CMD --endpoint ${NODE_RPC_URL} run remotely ${extra_args} ${BAKER_EXTRA_ARGS_FROM_ENV} ${BAKE_USING_ACCOUNTS} |
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{{- range $k, $v := .Values.bakers }} | ||
|
||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: baker-{{ $k }} | ||
spec: | ||
podManagementPolicy: Parallel | ||
replicas: 1 | ||
serviceName: baker-{{ $k }} | ||
selector: | ||
matchLabels: | ||
app: baker-{{ $k }} | ||
template: | ||
metadata: | ||
labels: | ||
app: baker-{{ $k }} | ||
spec: | ||
initContainers: | ||
- image: {{ $.Values.tezos_k8s_images.utils }} | ||
imagePullPolicy: Always | ||
name: config-generator | ||
args: | ||
- config-generator | ||
envFrom: | ||
- configMapRef: | ||
name: tezos-config | ||
env: | ||
- name: MY_POD_NAME | ||
value: {{ $k }} | ||
- name: MY_POD_TYPE | ||
value: baker | ||
volumeMounts: | ||
- mountPath: /var/tezos | ||
name: baker-volume | ||
- mountPath: /etc/secret-volume | ||
name: tezos-accounts | ||
containers: | ||
{{- $baker_name := index $v.bake_using_accounts 0 }} | ||
{{- $account := get $.Values.accounts $baker_name | default dict }} | ||
{{- range ( $account.protocols | default $.Values.protocols ) }} | ||
- name: octez-baker-{{ lower .command }} | ||
image: "{{ $.Values.images.octez }}" | ||
imagePullPolicy: IfNotPresent | ||
volumeMounts: | ||
- mountPath: /var/tezos | ||
name: baker-volume | ||
- mountPath: /etc/tezos/baker-config | ||
name: baker-config | ||
command: | ||
- /bin/sh | ||
args: | ||
- "-c" | ||
- | | ||
{{ tpl ($.Files.Get "scripts/rpc-baker.sh") $ | indent 12 }} | ||
env: | ||
- name: NODE_RPC_URL | ||
value: "{{ $v.node_rpc_url }}" | ||
- name: PROTO_COMMAND | ||
value: "{{ .command }}" | ||
- name: BAKER_NAME | ||
value: {{ $baker_name }} | ||
- name: BAKE_USING_ACCOUNTS | ||
value: {{ join " " $v.bake_using_accounts }} | ||
{{- if $v.operations_pool | default false }} | ||
- name: OPERATIONS_POOL | ||
value: "{{ $v.oprations_pool }}" | ||
{{- end }} | ||
{{- if $v.dal_node_rpc_url | default false }} | ||
- name: DAL_NODE_RPC_URL | ||
value: "{{ $v.dal_node_rpc_url }}" | ||
{{- end }} | ||
{{- end }} | ||
securityContext: | ||
fsGroup: 1000 | ||
volumes: | ||
- name: baker-config | ||
configMap: | ||
name: baker-config | ||
- name: tezos-accounts | ||
secret: | ||
secretName: tezos-secret | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: baker-volume | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
--- | ||
{{- 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
Oops, something went wrong.