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

Add CLI command to display formatted content of build_metadata #8

Draft
wants to merge 4 commits into
base: dev_202205
Choose a base branch
from

Conversation

maksymhedeon
Copy link

No description provided.

@maksymhedeon
Copy link
Author

githedgehog@sonic:/etc/sonic$ show metadata -h
Usage: show metadata [OPTIONS] COMMAND [ARGS]...

  Show build metadata related information

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  all            Show all build metadata
  channel        Show build channel branch
  date           Show build timestamp
  git            Show build Git info
  id             Show build ID
  specification  Show build specification info
githedgehog@sonic:/etc/sonic$ show metadata id
baac61ea-1596-42a5-849d-2c3919e10784

githedgehog@sonic:/etc/sonic$ show metadata date -h
Usage: show metadata date [OPTIONS]

  Show build timestamp

Options:
  -u, --unix      Show date in UNIX format
  -?, -h, --help  Show this message and exit.
githedgehog@sonic:/etc/sonic$ show metadata date 
2023-03-23 23:57:37
githedgehog@sonic:/etc/sonic$ show metadata date --unix
1679615857

githedgehog@sonic:/etc/sonic$ show metadata git
repo: https://github.com/githedgehog/sonic-buildimage.git
branch: HEAD
ref: a15ea062f


show/metadata.py Outdated Show resolved Hide resolved
@maksymhedeon maksymhedeon marked this pull request as ready for review March 27, 2023 14:45
@bratashX
Copy link

Could you please add an example of /etc/sonic/build_metadata.yaml in comment?

@maksymhedeon
Copy link
Author

id: 26dd76ac-01d2-4e7a-8496-4b5f2985fe19
date: 1679688604
channel: '202205'
git:
  repo: https://github.com/githedgehog/sonic-buildimage.git
  branch: dev_202205_deep_update_cleanup
  ref: 7b06b1380
spec:
  platform: vs
  arch: amd64
  usecase: Generic
  options: []
version:
  SONiC_Software_Version: dev_202205_deep_update_cleanup.288-7b06b1380
  distribution: '11.6'
  kernel: 5.10.0-18-2-amd64
  build_date: Fri Mar 24 20:10:04 UTC 2023
configuration:
  SONIC_VS_MINIMAL: n
  SONIC_MLNX_MINIMAL: n
  SONIC_INVM_MINIMAL: n
  SONIC_CONFIG_BUILD_JOBS: '1'
  SONIC_CONFIG_MAKE_JOBS: $(shell nproc)
  DEFAULT_BUILD_LOG_TIMESTAMP: none
  DEFAULT_USERNAME: githedgehog
  DEFAULT_PASSWORD: githedgehog
  SONIC_USE_PDDF_FRAMEWORK: y
  SONIC_ROUTING_STACK: frr
  ENABLE_ORGANIZATION_EXTENSIONS: y
  DEFAULT_KERNEL_PROCURE_METHOD: build
  FRR_USER_UID: '300'
  FRR_USER_GID: '300'
  SONIC_DPKG_CACHE_METHOD: none
  SONIC_DPKG_CACHE_SOURCE: /var/cache/sonic/artifacts
  DEFAULT_VS_PREPARE_MEM: 'yes'
  INCLUDE_SYSTEM_TELEMETRY: y
  INCLUDE_ICCPD: n
  INCLUDE_SFLOW: y
  ENABLE_SFLOW_DROPMON: n
  INCLUDE_MGMT_FRAMEWORK: y
  ENABLE_HOST_SERVICE_ON_START: n
  INCLUDE_RESTAPI: n
  INCLUDE_NAT: y
  INCLUDE_DHCP_RELAY: y
  INCLUDE_P4RT: n
  ENABLE_AUTO_TECH_SUPPORT: y
  INCLUDE_MACSEC: y
  INCLUDE_KUBERNETES: n
  KUBE_DOCKER_PROXY: http://172.16.1.1:3128/
  KUBERNETES_VERSION: 1.22.2-00
  K8s_GCR_IO_PAUSE_VERSION: '3.5'
  INCLUDE_KUBERNETES_MASTER: n
  MASTER_KUBERNETES_VERSION: 1.22.2-00
  MASTER_KUBERNETES_CONTAINER_IMAGE_VERSION: v1.22.2
  MASTER_PAUSE_VERSION: '3.5'
  MASTER_COREDNS_VERSION: v1.8.4
  MASTER_ETCD_VERSION: 3.5.0-0
  MASTER_CRI_DOCKERD: 0.2.5
  SONIC_ENABLE_IMAGE_SIGNATURE: n
  SONIC_ENABLE_SECUREBOOT_SIGNATURE: n
  PACKAGE_URL_PREFIX: https://packages.trafficmanager.net/public/packages
  TRUSTED_GPG_URLS: https://packages.trafficmanager.net/debian/public_key.gpg,https://packages.microsoft.com/keys/microsoft.asc
  SONIC_VERSION_CONTROL_COMPONENTS: none
  REGISTRY_PORT: '443'
  REGISTRY_SERVER: sonicdev-microsoft.azurecr.io
  BUILD_MULTIASIC_KVM: n
  INCLUDE_MUX: y
  ENABLE_ASAN: n
  DEFAULT_CONTAINER_REGISTRY: ''
  ENABLE_FIPS_FEATURE: y
  ENABLE_FIPS: n
  SONIC_SLAVE_DOCKER_DRIVER: vfs
  INCLUDE_SYSLOG: y
  INCLUDE_RADIUS: y
  INCLUDE_NTP: y
  INCLUDE_LLDP: y
  INCLUDE_SNMP: y
  INCLUDE_TEAMD: y
  INCLUDE_ROUTER_ADVERTISER: y
  INCLUDE_ROUTING_STACK: y
  INCLUDE_SWSS: y
  INCLUDE_PMON: y
  INCLUDE_DATABASE: y
  INCLUDE_SSH: y
  INCLUDE_SYNCD: y
  INCLUDE_FRR_BGP: n
  INCLUDE_FRR_BFD: y
  INCLUDE_FRR_PBR: y
  INCLUDE_FRR_VRRP: y
  INCLUDE_FRR_OSPF: y

show/main.py Outdated
@@ -219,6 +218,7 @@ def cli(ctx):

if 'INCLUDE_NAT: n' not in exclude_cli_list:
#add nat commands
from . import nat

Choose a reason for hiding this comment

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

Could you please move changes related to NAT to a separate commit?
Also, disable nat-related unit tests, when the feature disabled
.
Example for SNMP: https://github.com/githedgehog/sonic-buildimage/blob/fad529cc27eca5a1cbc769e3285dce38f74c34f1/rules/functions#L226

Signed-off-by: Maksym Hedeon <[email protected]>
@maksymhedeon maksymhedeon marked this pull request as draft March 28, 2023 15:43
@maksymhedeon
Copy link
Author

Hold because the metadata format changes

Maksym Hedeon added 2 commits April 5, 2023 13:42
Signed-off-by: Maksym Hedeon <[email protected]>
This reverts commit aafbc32.
@maksymhedeon
Copy link
Author

Hold because the metadata format changes

https://d.githedgehog.com/sonic/43cfae78-2037-4a4b-b7cf-e3e3c986cc12/metadata.yaml

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

Successfully merging this pull request may close these issues.

3 participants