Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update configurations for mirror uploader sidecars #138

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

leninmehedy
Copy link
Member

@leninmehedy leninmehedy commented Jul 5, 2023

Description

This pull request changes the following:

  • updates configs for mirror.py sidecar containers

Related Issues

Previously network-node-* containers were crashing and now with the updated config these are running as expected:

➜  full-stack-testing git:(113-fix-sidecar-configurations) ✗ kubectl get pods                                       
NAME                                READY   STATUS             RESTARTS      AGE
envoy-proxy-0-548cb4cbc7-c49c2      1/1     Running            0             66s
envoy-proxy-1-57c79b8c68-5klks      1/1     Running            0             66s
envoy-proxy-2-5f8ccbf6c5-69hrz      1/1     Running            0             66s
haproxy-0-6455cf747c-prqsz          0/1     CrashLoopBackOff   2 (26s ago)   66s
haproxy-1-74b45d4974-642vl          0/1     CrashLoopBackOff   2 (22s ago)   66s
haproxy-2-6c5d7d5cf-gsfp5           0/1     CrashLoopBackOff   2 (20s ago)   66s
json-rpc-relay-0-587db6bc89-hvkbx   0/1     ImagePullBackOff   0             66s
json-rpc-relay-1-8cbc8cc68-829sr    0/1     ImagePullBackOff   0             66s
json-rpc-relay-2-7c8f5dc9c5-n9bsb   0/1     ImagePullBackOff   0             66s
network-node-1-0                    6/6     Running            0             25s
network-node-2-0                    6/6     Running            0             25s
network-node-3-0                    6/6     Running            0             25s
➜  full-stack-testing git:(113-fix-sidecar-configurations) kubectl describe pod network-node-1-0                  
Name:             network-node-1-0
Namespace:        default
Priority:         0
Service Account:  default
Node:             fst-local-control-plane/172.18.0.3
Start Time:       Wed, 05 Jul 2023 12:18:24 +0930
Labels:           app=network-node-1
                  controller-revision-hash=network-node-1-6f9f8c5559
                  statefulset.kubernetes.io/pod-name=network-node-1-0
Annotations:      <none>
Status:           Running
IP:               10.244.0.76
IPs:
  IP:           10.244.0.76
Controlled By:  StatefulSet/network-node-1
Containers:
  root-container:
    Container ID:  containerd://f8905495b62ca16ce84c5c695725d73cf4f9a08a72e6a7650e9f367ae5f9c166
    Image:         ghcr.io/hashgraph/full-stack-testing/ubi8-init-dind:0.1.2
    Image ID:      ghcr.io/hashgraph/full-stack-testing/ubi8-init-dind@sha256:57942b3b1cab485f55878185ce03ef0a1ba1f275685c9f97f59e443cb2369ae1
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/sh
    Args:
      -c
      while true; do echo root:heartbeat; sleep 10;done
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     1
      memory:  1G
    Requests:
      cpu:        1
      memory:     1G
    Environment:  <none>
    Mounts:
      /opt/hgcapp/ from hgcapp-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
  account-balances-uploader:
    Container ID:  containerd://ec29f6b77f9b99b5cdfc8bc88c6ff8a82ccd639701f1db1262190ac7a56db68f
    Image:         gcr.io/hedera-registry/uploader-mirror:1.3.0
    Image ID:      gcr.io/hedera-registry/uploader-mirror@sha256:3e7c7229326b4f241cbd7a630fcb27d9742ac62d26dca04820e36d0f68e03f7a
    Port:          <none>
    Host Port:     <none>
    Command:
      /usr/bin/env
      python3.7
      /usr/local/bin/mirror.py
      --linux
      --watch-directory
      /opt/hgcapp/accountbalance
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      account-balance-uploader-config  ConfigMap  Optional: false
      uploader-secrets                 Secret     Optional: false
    Environment:                       <none>
    Mounts:
      /opt/hgcapp/accountbalance from hedera-account-balances (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
  event-stream-uploader:
    Container ID:  containerd://058ba43203d8cdc195bd760fe1bbcc6ed9f111818570d36d3c689f345ace5eeb
    Image:         gcr.io/hedera-registry/uploader-mirror:1.3.0
    Image ID:      gcr.io/hedera-registry/uploader-mirror@sha256:3e7c7229326b4f241cbd7a630fcb27d9742ac62d26dca04820e36d0f68e03f7a
    Port:          <none>
    Host Port:     <none>
    Command:
      /usr/bin/env
      python3.7
      /usr/local/bin/mirror.py
      --linux
      --watch-directory
      /opt/hgcapp/events
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      event-stream-uploader-config  ConfigMap  Optional: false
      uploader-secrets              Secret     Optional: false
    Environment:                    <none>
    Mounts:
      /opt/hgcapp/events from hedera-event-streams (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
  record-stream-uploader:
    Container ID:  containerd://2c7110755ddfcb0873ccfce53a3152ba388b0ab8eb53bd8cfcd8449be04797b7
    Image:         gcr.io/hedera-registry/uploader-mirror:1.3.0
    Image ID:      gcr.io/hedera-registry/uploader-mirror@sha256:3e7c7229326b4f241cbd7a630fcb27d9742ac62d26dca04820e36d0f68e03f7a
    Port:          <none>
    Host Port:     <none>
    Command:
      /usr/bin/env
      python3.7
      /usr/local/bin/mirror.py
      --linux
      --watch-directory
      /opt/hgcapp/recordstream
      --csv-stats-directory
      /opt/hgcapp/recordstream/uploader-stats/
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      record-stream-uploader-config  ConfigMap  Optional: false
      uploader-secrets               Secret     Optional: false
    Environment:                     <none>
    Mounts:
      /opt/hgcapp/recordstream from hedera-record-streams (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
  record-sidecar-uploader:
    Container ID:  containerd://ff286f4e550986840df2f2658b2970c05ed6a07556917e2253c62df2351eb621
    Image:         gcr.io/hedera-registry/uploader-mirror:1.3.0
    Image ID:      gcr.io/hedera-registry/uploader-mirror@sha256:3e7c7229326b4f241cbd7a630fcb27d9742ac62d26dca04820e36d0f68e03f7a
    Port:          <none>
    Host Port:     <none>
    Command:
      /usr/bin/env
      python3.7
      /usr/local/bin/mirror.py
      --linux
      --watch-directory
      /opt/hgcapp/sidecar
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      record-stream-sidecar-config  ConfigMap  Optional: false
      uploader-secrets              Secret     Optional: false
    Environment:                    <none>
    Mounts:
      /opt/hgcapp/sidecar from hedera-sidecar (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
  otel-collector:
    Container ID:   containerd://f93007fce6d26d16d178f6937a90acdf4791cbcabd15614e045f3735465f9a9f
    Image:          otel/opentelemetry-collector-contrib:0.72.0
    Image ID:       docker.io/otel/opentelemetry-collector-contrib@sha256:be76a0ac95d3c1ca39cf15ee5932bf53ea1d0d67e70feb9444a54074de6eb129
    Port:           13133/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Wed, 05 Jul 2023 12:18:25 +0930
    Ready:          True
    Restart Count:  0
    Liveness:       http-get http://:healthcheck/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:healthcheck/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:    <none>
    Mounts:
      /etc/otel-collector-config.yaml from otel-collector-config (ro,path="config.yaml")
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lx54n (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  hgcapp-dir:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  hedera-account-balances:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  hedera-event-streams:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  hedera-record-streams:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  hedera-sidecar:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  otel-collector-config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      otel-collector-config
    Optional:  false
  kube-api-access-lx54n:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age    From               Message
  ----    ------     ----   ----               -------
  Normal  Scheduled  2m30s  default-scheduler  Successfully assigned default/network-node-1-0 to fst-local-control-plane
  Normal  Pulled     2m29s  kubelet            Container image "ghcr.io/hashgraph/full-stack-testing/ubi8-init-dind:0.1.2" already present on machine
  Normal  Created    2m29s  kubelet            Created container root-container
  Normal  Started    2m29s  kubelet            Started container root-container
  Normal  Pulled     2m29s  kubelet            Container image "gcr.io/hedera-registry/uploader-mirror:1.3.0" already present on machine
  Normal  Created    2m29s  kubelet            Created container account-balances-uploader
  Normal  Started    2m29s  kubelet            Started container account-balances-uploader
  Normal  Pulled     2m29s  kubelet            Container image "gcr.io/hedera-registry/uploader-mirror:1.3.0" already present on machine
  Normal  Created    2m29s  kubelet            Created container event-stream-uploader
  Normal  Started    2m29s  kubelet            Started container event-stream-uploader
  Normal  Pulled     2m29s  kubelet            Container image "gcr.io/hedera-registry/uploader-mirror:1.3.0" already present on machine
  Normal  Created    2m29s  kubelet            Created container record-stream-uploader
  Normal  Started    2m29s  kubelet            Started container record-stream-uploader
  Normal  Pulled     2m29s  kubelet            Container image "gcr.io/hedera-registry/uploader-mirror:1.3.0" already present on machine
  Normal  Created    2m29s  kubelet            Created container record-sidecar-uploader
  Normal  Started    2m29s  kubelet            Started container record-sidecar-uploader
  Normal  Pulled     2m29s  kubelet            Container image "otel/opentelemetry-collector-contrib:0.72.0" already present on machine
  Normal  Created    2m29s  kubelet            Created container otel-collector
  Normal  Started    2m29s  kubelet            Started container otel-collector
➜  full-stack-testing git:(113-fix-sidecar-configurations) 

Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
@leninmehedy leninmehedy changed the title fix: fix sidecar configurations for mirror uploaders fix: update configurations for mirror uploader sidecars Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Unit Test Results

35 tests  ±0   32 ✔️ ±0   26s ⏱️ ±0s
  8 suites ±0     3 💤 ±0 
  8 files   ±0     0 ±0 

Results for commit dd3e572. ± Comparison against base commit 09de701.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #138 (dd3e572) into main (09de701) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #138   +/-   ##
=========================================
  Coverage     51.79%   51.79%           
  Complexity      139      139           
=========================================
  Files            36       36           
  Lines           668      668           
  Branches         73       73           
=========================================
  Hits            346      346           
  Misses          290      290           
  Partials         32       32           

Impacted file tree graph

image: {{ $.Values.infrastructure.docker.registry }}/{{ $.Values.infrastructure.docker.images.root }}
image: {{ $.Values.infrastructure.docker.images.root }}
command: [ "/bin/sh" ]
args: [ "-c", "while true; do echo root:heartbeat; sleep 10;done" ]
Copy link
Member Author

@leninmehedy leninmehedy Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are having this sleep block to keep the root container running.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior is incorrect as the root container should be our standard image running the full init process. If we are using the ubi8-init-dind or ubi8-init-java17 images then we should not be overriding the entrypoint/command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was just a temporary change. The root image didn't have an entry-point so it was terminating. I'll remove it with my next PR.

Signed-off-by: Deepak Mishra <deepak@swirldslabs.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@deepak-swirlds deepak-swirlds merged commit 118662f into main Jul 5, 2023
@deepak-swirlds deepak-swirlds deleted the 113-fix-sidecar-configurations branch July 5, 2023 11:54
swirlds-automation added a commit that referenced this pull request Jul 5, 2023
## [0.2.0](v0.1.2...v0.2.0) (2023-07-05)

### Features

* add github templates ([#124](#124)) ([7990742](7990742))
* add otel collector sidecar container ([#134](#134)) ([09de701](09de701))
* add semantic-release based CI pipelines ([#136](#136)) ([76055e0](76055e0))
* add SLF4J logging to fullstack-helm-client module ([#137](#137)) ([4115810](4115810))
* boilerplate helm chart ([#121](#121)) ([70c66ca](70c66ca))
* implement mirror.py container support (via side car) ([#135](#135)) ([c8ea9e2](c8ea9e2))
* publish the helm client to maven central ([#123](#123)) ([6b40d2d](6b40d2d))
* relocates the docker image definition and adds a new image definition ([#126](#126)) ([db59e7c](db59e7c))

### Bug Fixes

* update configurations for mirror uploader sidecars ([#138](#138)) ([118662f](118662f))
@swirlds-automation
Copy link
Contributor

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Charts[Network Node]: Implement root container support
4 participants