You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/09 07:47:42 UTC

[GitHub] [camel-k] astefanutti commented on a diff in pull request #3344: [WIP] configuring maven builds based on CPU quota if set any

astefanutti commented on code in PR #3344:
URL: https://github.com/apache/camel-k/pull/3344#discussion_r893176091


##########
pkg/util/maven/maven_command.go:
##########
@@ -74,6 +74,14 @@ func (c *Command) Do(ctx context.Context) error {
 		args = append(args, "--settings", settingsPath)
 	}
 
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "org.apache.camel.container.cpus="+cpuQuota)
+	}
+
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "maven.artifact.threads="+cpuQuota)

Review Comment:
   nit: maybe use the `-D` form to be consistent with the other system properties.



##########
pkg/util/maven/maven_command.go:
##########
@@ -74,6 +74,14 @@ func (c *Command) Do(ctx context.Context) error {
 		args = append(args, "--settings", settingsPath)
 	}
 
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "org.apache.camel.container.cpus="+cpuQuota)
+	}
+
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {

Review Comment:
   Following #2837, I think the `GOMAXPROCS` environment variable can be used here.



##########
pkg/util/maven/maven_command.go:
##########
@@ -74,6 +74,14 @@ func (c *Command) Do(ctx context.Context) error {
 		args = append(args, "--settings", settingsPath)
 	}
 
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "org.apache.camel.container.cpus="+cpuQuota)
+	}
+
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "maven.artifact.threads="+cpuQuota)

Review Comment:
   What about setting the `-T` option as well?



##########
pkg/util/maven/maven_command.go:
##########
@@ -74,6 +74,14 @@ func (c *Command) Do(ctx context.Context) error {
 		args = append(args, "--settings", settingsPath)
 	}
 
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "org.apache.camel.container.cpus="+cpuQuota)
+	}
+
+	if cpuQuota, ok := os.LookupEnv("CPU_QUOTA"); ok {
+		args = append(args, "--define", "maven.artifact.threads="+cpuQuota)

Review Comment:
   It should only be added if it's not already present in `AdditionalArguments`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org