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

CDP-8328: add normandie status and knox status to ping requests and hosts_and_agents sql table #1745

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tweedeldee
Copy link
Contributor

@Tweedeldee Tweedeldee commented Nov 7, 2024

Description

Add normandie status and knox status to ping requests and hosts_and_agents sql table
CDP-8328

Development status

  • Normandie status is defined by the presence of a valid normandie's certificate.
  • Knox status is currently NOT retrieved.
  • Both fields are emitted in ping requests and stored in hosts_and_agents SQL table

Associated PRs

https://github.com/pinternal/mysql_schemas/pull/1209

@Tweedeldee Tweedeldee requested a review from a team as a code owner November 7, 2024 18:12
@github-actions github-actions bot added deploy-service Includes changes to deploy-service deploy-agent Includes changes to deploy-agent labels Nov 7, 2024
@Tweedeldee Tweedeldee marked this pull request as draft November 7, 2024 18:13
@Tweedeldee
Copy link
Contributor Author

Tweedeldee commented Nov 9, 2024

Test in devapp

deploy-agent alone, with valid Normandie certificate

Commands

sudo PINLOG_MIN_LOG_LEVEL=DEBUG PINLOG_LOG_TO_STDERR=1 PINLOG_STDERR_LEVEL=DEBUG PINLOG_LOG_DIR=/var/log/deployd IS_PINTEREST=true METRIC_PORT_HEALTH=18126 METRIC_CACHE_PATH=/mnt/deployd/metrics.cache PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ~/code/teletraan/deploy-agent/bazel-bin/deployd/deploy-agent -e prod -f /etc/deployagent.conf --use-facter

Output, slightly reformated

D23:08:40 [deployd.client.client] PingRequest(hostId=i-0fa4dfea2b1b5f531, hostName=devrestricted-jpierre, hostIp=10.9.196.125, agentVersion=1.2.65-pinterest-1.0.2, autoscalingGroup=None, availabilityZone=us-east-1a, ec2Tags={"Name": "devrestricted-jpierre", "devapp_version": "None", "service_mapping": "dev", "usage_tag": "Dev Apps", "username": "jpierre", "availability_zone": "us-east-1a"}, stageType=None, groups=['singer-prod-sidecar', 'envoy-devapp', 'tcollector-prod-sidecar', 'mcrouter-devapp', 'mcrouter-prod-sidecar', 'metrics-agent-prod-sidecar', 'zk_update_monitor-prod-sidecar'], accountId=998131032990, 

normandieStatus=OK, knoxStatus=NotImplementedYet, 

reports=PingReport([...]) -> PingResponse(opCode=NOOP, deployGoal=None)

deploy-agent along with dev1 deploy-service

Test conditions:

  • deploy-service deployed to dev1
  • deploy-agent built on devapp, pointed at dev1 deploy-service with a custom .conf file

Ran deploy-agent with command

sudo PINLOG_MIN_LOG_LEVEL=DEBUG PINLOG_LOG_TO_STDERR=1 PINLOG_STDERR_LEVEL=DEBUG PINLOG_LOG_DIR=/var/log/deployd IS_PINTEREST=true METRIC_PORT_HEALTH=18126 METRIC_CACHE_PATH=/mnt/deployd/metrics.cache bazel run deployd:deploy-agent -- --use-facter -f ~/deployagent-dev1.conf

deploy-agent output

D00:06:17 [deployd.client.client] PingRequest(hostId=i-0fa4dfea2b1b5f531, hostName=devrestricted-jpierre, hostIp=10.9.196.125, agentVersion=1.2.65-pinterest-1.0.2, autoscalingGroup=None, availabilityZone=us-east-1a, ec2Tags={"Name": "devrestricted-jpierre", "devapp_version": "None", "service_mapping": "dev", "usage_tag": "Dev Apps", "username": "jpierre", "availability_zone": "us-east-1a"}, stageType=None, groups=['singer-prod-sidecar', 'envoy-devapp', 'tcollector-prod-sidecar', 'mcrouter-devapp', 'mcrouter-prod-sidecar', 'metrics-agent-prod-sidecar', 'zk_update_monitor-prod-sidecar'], accountId=998131032990, normandieStatus=OK, knoxStatus=NotImplementedYet, reports=PingReport(deployId=am7lNy86TnOO1zicdIfO4w, envId=31_uRMuGReysBYSKPVolHQ, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=beacon:healthy, agentState=None),PingReport(deployId=Bo_AhGVTTz6a-pYA381Zxw, envId=pVGHjk5bQYaIqnp_e6hGJg, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=None, agentState=None),PingReport(deployId=k7vlKPllSXq0npHGXuT5lQ, envId=inbDfs6KQICpRRfuKQw_bQ, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=envoy-B:healthy;envoy-A:healthy;envoy-endpoint-register:healthy, agentState=None),PingReport(deployId=VCjgdlCXSNiEJE-d8d9uTA, envId=2XwshUOHR36DGEAH4PzBwg, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=mcrouter:healthy, agentState=None),PingReport(deployId=tdN6tMGIRWSen9nGZbTmJQ, envId=XbaIYCyjSY2tZTbUC9p3PQ, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=metrics-agent:healthy, agentState=None),PingReport(deployId=a4mYT2xVTj6H2cg0FEEBDA, envId=typrFRIFR6-lDyaiNjAk9w, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=pastis_proxy:healthy, agentState=None),PingReport(deployId=rXain9xJS-eoMeIt9wd7gQ, envId=gu2DEmL4Tv2XOqDKFc7Axw, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=ratelimit-A:healthy, agentState=None),PingReport(deployId=GNphRufgRd2EBQC3r0cfVQ, envId=I9VjP9AITXON9LYbSa8dXQ, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=singer:healthy, agentState=None),PingReport(deployId=zSQhe2PWQuilfgqcZRBfoQ, envId=4cgyBYX0RCCbJD-eUfk1jg, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=tcollector:healthy, agentState=None),PingReport(deployId=FX39q5UXSraKecXgBDItJg, envId=VI1mNs9DQuGG4GdKACl_pA, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=None, agentState=None),PingReport(deployId=bEtbG7wmSimqqhzTNFYPZg, envId=MWJwccIbSj-rnDkxF3Q7EQ, deployStage=SERVING_BUILD, status=SUCCEEDED, errorCode=0, errorMessage=None, failCount=0, extraInfo=None, deployAlias=None, containerHealthStatus=zk_update_monitor:healthy, agentState=None)) 
-> 
PingResponse(opCode=DELETE, deployGoal=DeployGoal(deployId=zSQhe2PWQuilfgqcZRBfoQ, envId=4cgyBYX0RCCbJD-eUfk1jg, envName=None, stageName=None, stageType=None, deployStage=SERVING_BUILD, build=None, deployAlias=None, agentConfig=None,scriptVariables=None, firstDeploy=False, isDocker=None))

dev1 database

teletraan-dev1.proxysql.pinadmin.com deploy kxttdev12403(ttdev1)> select * from hosts_and_agents where host_name like '%jpierre%';
+---------------------+------------------------+-----------------------+--------------+---------------+---------------+--------------------+------------------+-------------------+
| host_id             | agent_version          | host_name             | ip           | create_date   | last_update   | auto_scaling_group | normandie_status | knox_status       |
+---------------------+------------------------+-----------------------+--------------+---------------+---------------+--------------------+------------------+-------------------+
| i-0fa4dfea2b1b5f531 | 1.2.65-pinterest-1.0.2 | devrestricted-jpierre | 10.9.196.125 | 1731110776952 | 1731110776952 | NULL               | OK               | NotImplementedYet |
+---------------------+------------------------+-----------------------+--------------+---------------+---------------+--------------------+------------------+-------------------+
1 row in set (0.00 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-agent Includes changes to deploy-agent deploy-service Includes changes to deploy-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant