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

Feature: Reduce build log verbosity #3243

Closed
wants to merge 4 commits into from
Closed

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Aug 7, 2022

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

The main goal is to reduce the entirety of the set +x/-x usage and only display useful information. Previously there was too much debugging information which with all the set +x/-x usage would obscure a lot of the warnings. A lot of YAML is also dumped straight into stdout for no real reason beyond being able to see what is created, for most users this is unused or just causes bulk on build logs for no reason.

This PR introduces a new flag though which can be set in the controller or as an environment variable to expose the created YAML files if required:

  • LAGOON_FEATURE_FLAG_FORCE_BUILD_VERBOSITY=enabled (controller)
  • LAGOON_FEATURE_FLAG_BUILD_VERBOSITY=enabled (environment variable)
  • LAGOON_FEATURE_FLAG_DEFAULT_BUILD_VERBOSITY=enabled (controller)

An example build log is available here: https://gist.github.com/shreddedbacon/2ebb0f5cbc0ab524813959de1436ea2c

@shreddedbacon shreddedbacon changed the title feat: reduce build log verbosity Feature: Reduce build log verbosity Aug 8, 2022
@shreddedbacon shreddedbacon marked this pull request as ready for review August 8, 2022 00:56
@shreddedbacon
Copy link
Member Author

Additional work will be done in the uselagoon/build-deploy-tool for making build log output more standardised, but this is a starting point for reducing verbosity initially

@tobybellwood
Copy link
Member

We can also update the line in exec-push-parallel.sh that controls the pushing into the registry to suppress the hundreds of lines - note that the --quiet doesn't suppress those lines, only the digest line 🤒

echo "docker push ${REGISTRY}/${PROJECT}/${ENVIRONMENT}/${IMAGE_NAME}:${IMAGE_TAG:-latest} | grep -v -E 'Waiting|Layer already exists|Preparing'" >> /kubectl-build-deploy/lagoon/push

Which gives the following instead:

STEP Push images to registry
The push refers to repository [registry.192.168.1.51.nip.io:32080/ci-drupal-pg-control-k8s/drupal9-php80-postgres-single/nginx]
latest: digest: sha256:c63330919b7a6d8b7d1b829fef69e5fcf838055a9eb2ce3f4bb847ac44166020 size: 5942
The push refers to repository [registry.192.168.1.51.nip.io:32080/ci-drupal-pg-control-k8s/drupal9-php80-postgres-single/cli]
latest: digest: sha256:41468e8e881c355b3d81694e1e5a6809409db70ff9557f69c7a47617ed49b52b size: 11167
The push refers to repository [registry.192.168.1.51.nip.io:32080/ci-drupal-pg-control-k8s/drupal9-php80-postgres-single/postgres]
latest: digest: sha256:89609dbc79b749b440f301524c05d185be0e2091807b460c34ffbbfabdc302bc size: 3652
The push refers to repository [registry.192.168.1.51.nip.io:32080/ci-drupal-pg-control-k8s/drupal9-php80-postgres-single/php]
latest: digest: sha256:558ab2bd58800a97e576a06503e0771624425409de82e6c2fb65a76d078b2145 size: 6586
##############################################
STEP Image Push to Registry: Completed at 2022-08-08 06:03:08 (UTC) Duration 00:00:04 Elapsed 00:00:15
##############################################

tobybellwood added a commit to uselagoon/build-deploy-tool that referenced this pull request Aug 18, 2022
@tobybellwood
Copy link
Member

continued in uselagoon/build-deploy-tool#88

@tobybellwood tobybellwood deleted the build-log-verbosity branch July 24, 2023 06:25
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.

2 participants