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

Enable caching in Serverless and disable colors in logs #8369

Merged
merged 2 commits into from
May 15, 2020
Merged

Enable caching in Serverless and disable colors in logs #8369

merged 2 commits into from
May 15, 2020

Conversation

hudymi
Copy link
Contributor

@hudymi hudymi commented May 5, 2020

Description

Changes proposed in this pull request:

  • Enable caching - when there are no changes in package.json lambda is built in 9s, when there are no changes at all then 5s and sometimes less

  • Disable colors in output as it is looking ugly in logs

    Before:
    image

    After:
    image

    Unfortunately, the timestamp column is added by UI...

@hudymi hudymi added the area/serverless Issues or PRs related to serverless label May 5, 2020
@hudymi hudymi requested a review from a user May 5, 2020 16:54
@hudymi hudymi requested a review from sayanh as a code owner May 5, 2020 16:54
@netlify
Copy link

netlify bot commented May 5, 2020

🥰 Documentation preview ready! 🥰

Built with commit 3b41ca0

https://deploy-preview-8369--kyma-project-docs-preview.netlify.app

@aerfio
Copy link
Contributor

aerfio commented May 5, 2020

@hudymi hudymi added the WIP label May 5, 2020
@hudymi
Copy link
Contributor Author

hudymi commented May 5, 2020

Yup, I know. I created this PR to generate image :P screens are from changes in kaniko arguments

@hudymi hudymi changed the title Disable colored output in serverless runtime Enable caching in Serverless and disabled colored logs May 5, 2020
@hudymi hudymi added kind/feature Categorizes issue or PR as related to a new feature. and removed WIP labels May 5, 2020
@hudymi
Copy link
Contributor Author

hudymi commented May 5, 2020

I'm not sure if we should configure --cache-ttl, default it is two weeks: https://github.com/GoogleContainerTools/kaniko/blob/master/cmd/executor/cmd/root.go#L157

Let's leave as it is for now.

@@ -88,7 +88,7 @@ func (r *FunctionReconciler) buildJob(instance *serverlessv1alpha1.Function, con
{
Name: "executor",
Image: r.config.Build.ExecutorImage,
Args: []string{fmt.Sprintf("--destination=%s", imageName), "--insecure", "--skip-tls-verify"},
Args: append(r.config.Build.ExecutorArgs, fmt.Sprintf("--destination=%s", imageName), "--context=dir:///workspace"),
Copy link
Contributor Author

@hudymi hudymi May 5, 2020

Choose a reason for hiding this comment

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

--destination and --context shouldn't be configurable as it is strictly related to volumes and docker repository...

@hudymi hudymi changed the title Enable caching in Serverless and disabled colored logs Enable caching in Serverless and disable colored logs May 5, 2020
@hudymi hudymi changed the title Enable caching in Serverless and disable colored logs Enable caching in Serverless and disable colore logs May 5, 2020
@hudymi hudymi changed the title Enable caching in Serverless and disable colore logs Enable caching in Serverless and disable colors in logs May 5, 2020
@@ -24,7 +24,8 @@ type BuildConfig struct {
LimitsMemory string `envconfig:"default=1Gi"`
LimitsMemoryValue resource.Quantity `envconfig:"-"`
RuntimeConfigMapName string `envconfig:"default=dockerfile-nodejs-12"`
ExecutorImage string `envconfig:"default=gcr.io/kaniko-project/executor:v0.19.0"`
ExecutorArgs []string `envconfig:"default=--insecure;--skip-tls-verify;--skip-unused-stages;--log-format=text;--cache=true"`
Copy link
Contributor

Choose a reason for hiding this comment

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

--insecure and --skip-tls-verify shouldn't be set from env

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not exactly, this is only valid when our internal docker registry is used

@@ -100,8 +100,10 @@ containers:
value: 5m
functionRequeueDuration:
value: 5m
functionBuildExecutorArgs:
value: "--insecure,--skip-tls-verify,--skip-unused-stages,--log-format=text,--cache=true"
Copy link
Contributor

Choose a reason for hiding this comment

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

see previous comment

@hudymi hudymi modified the milestones: Sprint_Wookiee_42, 1.13 May 6, 2020
@hudymi hudymi merged commit 01eacd3 into kyma-project:master May 15, 2020
@hudymi hudymi deleted the michal-hudy-patch-1 branch May 15, 2020 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/serverless Issues or PRs related to serverless kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants