[arvados] updated: 2.7.0-6547-gf049ebcb40

git repository hosting git at public.arvados.org
Mon May 6 14:02:26 UTC 2024


Summary of changes:
 doc/admin/upgrading.html.textile.liquid            | 15 +++++++++
 lib/config/config.default.yml                      | 39 ----------------------
 lib/controller/handler_test.go                     |  4 +--
 lib/controller/trash.go                            | 21 +++++++++---
 lib/crunchrun/crunchrun_test.go                    | 10 ++----
 sdk/go/arvados/config.go                           | 13 ++------
 sdk/python/tests/run_test_server.py                |  5 +--
 .../controllers/arvados/v1/schema_controller.rb    |  7 ----
 services/api/config/arvados_config.rb              |  8 -----
 9 files changed, 39 insertions(+), 83 deletions(-)

       via  f049ebcb40b5509413f73840ead3ef8893f9331b (commit)
       via  47a0e74fd1c13060fc3e38fe30dafc8686b5d113 (commit)
       via  92d6698f3c2d1c8109a9cf08f25da408c3a7b442 (commit)
      from  09fdded2857597bd3d3ea5a0029fecbe993130ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f049ebcb40b5509413f73840ead3ef8893f9331b
Author: Tom Clegg <tom at curii.com>
Date:   Mon May 6 10:02:14 2024 -0400

    21611: Remove configs for periodic container log sweep.
    
    Now that there are no new container logs being written to the logs
    table, we can just delete the remaining entries and stop checking.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/doc/admin/upgrading.html.textile.liquid b/doc/admin/upgrading.html.textile.liquid
index 1e7f0c7c7b..5d3d21bab1 100644
--- a/doc/admin/upgrading.html.textile.liquid
+++ b/doc/admin/upgrading.html.textile.liquid
@@ -32,9 +32,9 @@ h2(#main). development main
 
 "previous: Upgrading to 2.7.1":#v2_7_1
 
-h3. Obsolete container logging configuration entries have been removed
+h3. Legacy container logging system has been removed
 
-The following configuration keys are no longer used. Remove them from your @/etc/arvados/config.yml@ file to avoid warnings when services start up.
+The following configuration keys are no longer supported. Remove them from your @/etc/arvados/config.yml@ file to avoid warnings when services start up.
 * Containers.Logging.LimitLogBytesPerJob
 * Containers.Logging.LogBytesPerEvent
 * Containers.Logging.LogPartialLineThrottlePeriod
@@ -42,6 +42,10 @@ The following configuration keys are no longer used. Remove them from your @/etc
 * Containers.Logging.LogThrottleBytes
 * Containers.Logging.LogThrottleLines
 * Containers.Logging.LogThrottlePeriod
+* Containers.Logging.MaxAge
+* Containers.Logging.SweepInterval
+
+Any container logging content remaining in the database from the legacy system will be deleted.
 
 h3. Virtual environments inside distribution Python packages have moved
 
diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index b3e0d0657c..5ff030cdb1 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -1235,16 +1235,6 @@ Clusters:
       LocalKeepLogsToContainerLog: none
 
       Logging:
-        # Periodically (see SweepInterval) Arvados will check for
-        # containers that have been finished for at least this long,
-        # and delete their stdout, stderr, arv-mount, crunch-run, and
-        # crunchstat logs from the logs table.
-        MaxAge: 720h
-
-        # How often to delete cached log entries for finished
-        # containers (see MaxAge).
-        SweepInterval: 12h
-
         # Container logs are written to Keep and saved in a
         # collection, which is updated periodically while the
         # container runs.  This value sets the interval between
diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index 7d5e693f5b..afc7ec93bf 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -707,14 +707,14 @@ func (s *HandlerSuite) TestTrashSweep(c *check.C) {
 
 func (s *HandlerSuite) TestContainerLogSweep(c *check.C) {
 	s.cluster.SystemRootToken = arvadostest.SystemRootToken
-	s.cluster.Containers.Logging.SweepInterval = arvados.Duration(time.Second / 10)
+	s.cluster.Collections.TrashSweepInterval = arvados.Duration(2 * time.Second)
 	s.handler.CheckHealth()
 	ctx := auth.NewContext(s.ctx, &auth.Credentials{Tokens: []string{arvadostest.ActiveTokenV2}})
 	logentry, err := s.handler.federation.LogCreate(ctx, arvados.CreateOptions{Attrs: map[string]interface{}{
 		"object_uuid": arvadostest.CompletedContainerUUID,
 		"event_type":  "stderr",
 		"properties": map[string]interface{}{
-			"text": "test trash sweep\n",
+			"text": "test container log sweep\n",
 		},
 	}})
 	c.Assert(err, check.IsNil)
diff --git a/lib/controller/trash.go b/lib/controller/trash.go
index 99e7aec0b6..d1a54b4238 100644
--- a/lib/controller/trash.go
+++ b/lib/controller/trash.go
@@ -46,7 +46,19 @@ func (h *Handler) trashSweepWorker() {
 }
 
 func (h *Handler) containerLogSweepWorker() {
-	h.periodicWorker("container log sweep", h.Cluster.Containers.Logging.SweepInterval.Duration(), dblock.ContainerLogSweep, func(ctx context.Context) error {
+	// Since #21611 we don't expect any new log entries, so the
+	// periodic worker only runs once, then becomes a no-op.
+	//
+	// The old Containers.Logging.SweepInterval config is removed.
+	// We use TrashSweepInterval here instead, for testing
+	// reasons: it prevents the default integration-testing
+	// controller service (whose TrashSweepInterval is 0) from
+	// acquiring the dblock.
+	done := false
+	h.periodicWorker("container log sweep", h.Cluster.Collections.TrashSweepInterval.Duration(), dblock.ContainerLogSweep, func(ctx context.Context) error {
+		if done {
+			return nil
+		}
 		db, err := h.dbConnector.GetDB(ctx)
 		if err != nil {
 			return err
@@ -56,9 +68,7 @@ DELETE FROM logs
  USING containers
  WHERE logs.object_uuid=containers.uuid
  AND logs.event_type in ('stdout', 'stderr', 'arv-mount', 'crunch-run', 'crunchstat', 'hoststat', 'node', 'container', 'keepstore')
- AND containers.log IS NOT NULL
- AND now() - containers.finished_at > $1::interval`,
-			h.Cluster.Containers.Logging.MaxAge.String())
+ AND containers.log IS NOT NULL`)
 		if err != nil {
 			return err
 		}
@@ -68,6 +78,9 @@ DELETE FROM logs
 			logger.WithError(err).Warn("unexpected error from RowsAffected()")
 		} else {
 			logger.WithField("rows", rows).Info("deleted rows from logs table")
+			if rows == 0 {
+				done = true
+			}
 		}
 		return nil
 	})
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 60725fcd6d..8572613e94 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -506,8 +506,6 @@ type ContainersConfig struct {
 		Enable string
 	}
 	Logging struct {
-		MaxAge          Duration
-		SweepInterval   Duration
 		LogUpdatePeriod Duration
 		LogUpdateSize   ByteSize
 	}
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index b17f569b4d..d5a3db1f5d 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -788,13 +788,10 @@ def setup_config():
                     "BlobSigningKey": "zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc",
                     "TrustAllContent": False,
                     "ForwardSlashNameSubstitution": "/",
-                    "TrashSweepInterval": "-1s",
+                    "TrashSweepInterval": "-1s", # disable, otherwise test cases can't acquire dblock
                 },
                 "Containers": {
                     "LocalKeepBlobBuffersPerVCPU": 0,
-                    "Logging": {
-                        "SweepInterval": 0, # disable, otherwise test cases can't acquire dblock
-                    },
                     "SupportedDockerImageFormats": {"v1": {}},
                     "ShellAccess": {
                         "Admin": True,
diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb
index 0a3b99dabd..c3a1bed482 100644
--- a/services/api/config/arvados_config.rb
+++ b/services/api/config/arvados_config.rb
@@ -132,7 +132,6 @@ arvcfg.declare_config "Containers.MaxRetryAttempts", Integer, :container_count_m
 arvcfg.declare_config "Containers.AlwaysUsePreemptibleInstances", Boolean, :preemptible_instances
 arvcfg.declare_config "Containers.Logging.LogUpdatePeriod", ActiveSupport::Duration, :crunch_log_update_period
 arvcfg.declare_config "Containers.Logging.LogUpdateSize", Integer, :crunch_log_update_size
-arvcfg.declare_config "Containers.Logging.MaxAge", ActiveSupport::Duration, :clean_container_log_rows_after
 arvcfg.declare_config "Mail.MailchimpAPIKey", String, :mailchimp_api_key
 arvcfg.declare_config "Mail.MailchimpListID", String, :mailchimp_list_id
 arvcfg.declare_config "Services.Controller.ExternalURL", URI

commit 47a0e74fd1c13060fc3e38fe30dafc8686b5d113
Author: Tom Clegg <tom at curii.com>
Date:   Mon May 6 09:19:07 2024 -0400

    21611: Add upgrade note about removed configs.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/doc/admin/upgrading.html.textile.liquid b/doc/admin/upgrading.html.textile.liquid
index 320f188812..1e7f0c7c7b 100644
--- a/doc/admin/upgrading.html.textile.liquid
+++ b/doc/admin/upgrading.html.textile.liquid
@@ -32,6 +32,17 @@ h2(#main). development main
 
 "previous: Upgrading to 2.7.1":#v2_7_1
 
+h3. Obsolete container logging configuration entries have been removed
+
+The following configuration keys are no longer used. Remove them from your @/etc/arvados/config.yml@ file to avoid warnings when services start up.
+* Containers.Logging.LimitLogBytesPerJob
+* Containers.Logging.LogBytesPerEvent
+* Containers.Logging.LogPartialLineThrottlePeriod
+* Containers.Logging.LogSecondsBetweenEvents
+* Containers.Logging.LogThrottleBytes
+* Containers.Logging.LogThrottleLines
+* Containers.Logging.LogThrottlePeriod
+
 h3. Virtual environments inside distribution Python packages have moved
 
 The distribution packages that we publish for Python packages include an entire virtualenv with all required libraries. In Arvados 3.0 these virtualenvs have moved from @/usr/share/python3/dist/PACKAGE_NAME@ to @/usr/lib/PACKAGE_NAME@ to prevent conflicts with distribution packages and better conform to filesystem standards.

commit 92d6698f3c2d1c8109a9cf08f25da408c3a7b442
Author: Tom Clegg <tom at curii.com>
Date:   Fri May 3 14:25:01 2024 -0400

    21611: Remove obsolete configs.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index b045553b23..b3e0d0657c 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -1245,35 +1245,6 @@ Clusters:
         # containers (see MaxAge).
         SweepInterval: 12h
 
-        # These two settings control how frequently log events are flushed to the
-        # database.  Log lines are buffered until either crunch_log_bytes_per_event
-        # has been reached or crunch_log_seconds_between_events has elapsed since
-        # the last flush.
-        LogBytesPerEvent: 4096
-        LogSecondsBetweenEvents: 5s
-
-        # The sample period for throttling logs.
-        LogThrottlePeriod: 60s
-
-        # Maximum number of bytes that job can log over crunch_log_throttle_period
-        # before being silenced until the end of the period.
-        LogThrottleBytes: 65536
-
-        # Maximum number of lines that job can log over crunch_log_throttle_period
-        # before being silenced until the end of the period.
-        LogThrottleLines: 1024
-
-        # Maximum bytes that may be logged as legacy log events
-        # (records posted to the "logs" table). Starting with Arvados
-        # 2.7, container live logging has migrated to a new system
-        # (polling the container request live log endpoint) and this
-        # value should be 0.  As of this writing, the container will
-        # still create a single log on the API server, noting for that
-        # log events are throttled.
-        LimitLogBytesPerJob: 0
-
-        LogPartialLineThrottlePeriod: 5s
-
         # Container logs are written to Keep and saved in a
         # collection, which is updated periodically while the
         # container runs.  This value sets the interval between
diff --git a/lib/crunchrun/crunchrun_test.go b/lib/crunchrun/crunchrun_test.go
index b7635f0ecd..e51dfe629b 100644
--- a/lib/crunchrun/crunchrun_test.go
+++ b/lib/crunchrun/crunchrun_test.go
@@ -308,14 +308,8 @@ func (client *ArvTestClient) Update(resourceType string, uuid string, parameters
 }
 
 var discoveryMap = map[string]interface{}{
-	"defaultTrashLifetime":               float64(1209600),
-	"crunchLimitLogBytesPerJob":          float64(67108864),
-	"crunchLogThrottleBytes":             float64(65536),
-	"crunchLogThrottlePeriod":            float64(60),
-	"crunchLogThrottleLines":             float64(1024),
-	"crunchLogPartialLineThrottlePeriod": float64(5),
-	"crunchLogBytesPerEvent":             float64(4096),
-	"crunchLogSecondsBetweenEvents":      float64(1),
+	"crunchLogUpdateSize":   float64(crunchLogUpdateSize),
+	"crunchLogUpdatePeriod": float64(crunchLogUpdatePeriod.Seconds()),
 }
 
 func (client *ArvTestClient) Discovery(key string) (interface{}, error) {
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 6725611fd0..60725fcd6d 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -506,17 +506,10 @@ type ContainersConfig struct {
 		Enable string
 	}
 	Logging struct {
-		MaxAge                       Duration
-		SweepInterval                Duration
-		LogBytesPerEvent             int
-		LogSecondsBetweenEvents      Duration
-		LogThrottlePeriod            Duration
-		LogThrottleBytes             int
-		LogThrottleLines             int
-		LimitLogBytesPerJob          int
-		LogPartialLineThrottlePeriod Duration
-		LogUpdatePeriod              Duration
-		LogUpdateSize                ByteSize
+		MaxAge          Duration
+		SweepInterval   Duration
+		LogUpdatePeriod Duration
+		LogUpdateSize   ByteSize
 	}
 	ShellAccess struct {
 		Admin bool
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb
index ca803fd386..dd7a7a759e 100644
--- a/services/api/app/controllers/arvados/v1/schema_controller.rb
+++ b/services/api/app/controllers/arvados/v1/schema_controller.rb
@@ -57,13 +57,6 @@ class Arvados::V1::SchemaController < ApplicationController
       maxRequestSize: Rails.configuration.API.MaxRequestSize,
       maxItemsPerResponse: Rails.configuration.API.MaxItemsPerResponse,
       dockerImageFormats: Rails.configuration.Containers.SupportedDockerImageFormats.keys,
-      crunchLogBytesPerEvent: Rails.configuration.Containers.Logging.LogBytesPerEvent,
-      crunchLogSecondsBetweenEvents: Rails.configuration.Containers.Logging.LogSecondsBetweenEvents,
-      crunchLogThrottlePeriod: Rails.configuration.Containers.Logging.LogThrottlePeriod,
-      crunchLogThrottleBytes: Rails.configuration.Containers.Logging.LogThrottleBytes,
-      crunchLogThrottleLines: Rails.configuration.Containers.Logging.LogThrottleLines,
-      crunchLimitLogBytesPerJob: Rails.configuration.Containers.Logging.LimitLogBytesPerJob,
-      crunchLogPartialLineThrottlePeriod: Rails.configuration.Containers.Logging.LogPartialLineThrottlePeriod,
       crunchLogUpdatePeriod: Rails.configuration.Containers.Logging.LogUpdatePeriod,
       crunchLogUpdateSize: Rails.configuration.Containers.Logging.LogUpdateSize,
       remoteHosts: remoteHosts,
diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb
index f514fee641..0a3b99dabd 100644
--- a/services/api/config/arvados_config.rb
+++ b/services/api/config/arvados_config.rb
@@ -130,13 +130,6 @@ arvcfg.declare_config "Containers.DefaultKeepCacheRAM", Integer, :container_defa
 arvcfg.declare_config "Containers.MaxDispatchAttempts", Integer, :max_container_dispatch_attempts
 arvcfg.declare_config "Containers.MaxRetryAttempts", Integer, :container_count_max
 arvcfg.declare_config "Containers.AlwaysUsePreemptibleInstances", Boolean, :preemptible_instances
-arvcfg.declare_config "Containers.Logging.LogBytesPerEvent", Integer, :crunch_log_bytes_per_event
-arvcfg.declare_config "Containers.Logging.LogSecondsBetweenEvents", ActiveSupport::Duration, :crunch_log_seconds_between_events
-arvcfg.declare_config "Containers.Logging.LogThrottlePeriod", ActiveSupport::Duration, :crunch_log_throttle_period
-arvcfg.declare_config "Containers.Logging.LogThrottleBytes", Integer, :crunch_log_throttle_bytes
-arvcfg.declare_config "Containers.Logging.LogThrottleLines", Integer, :crunch_log_throttle_lines
-arvcfg.declare_config "Containers.Logging.LimitLogBytesPerJob", Integer, :crunch_limit_log_bytes_per_job
-arvcfg.declare_config "Containers.Logging.LogPartialLineThrottlePeriod", ActiveSupport::Duration, :crunch_log_partial_line_throttle_period
 arvcfg.declare_config "Containers.Logging.LogUpdatePeriod", ActiveSupport::Duration, :crunch_log_update_period
 arvcfg.declare_config "Containers.Logging.LogUpdateSize", Integer, :crunch_log_update_size
 arvcfg.declare_config "Containers.Logging.MaxAge", ActiveSupport::Duration, :clean_container_log_rows_after

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list