Repository: bacalhau-project/bacalhau (language: python)

Issue:
CI Image is deprecated
The image we have selected to use in CircleCI has been deprecated in line with https://discuss.circleci.com/t/linux-image-deprecations-and-eol-for-2024/50177 

We should update the image.


Discussion / hints:

Fix patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index f07b2d1f53..badc6537ee 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,11 +9,11 @@ executors:
   # Available resource classes - https://circleci.com/product/features/resource-classes/
   linux-amd64:
     machine:
-      image: ubuntu-2204:2022.07.1
+      image: default
       resource_class: xlarge
   linux-arm64:
     machine:
-      image: ubuntu-2204:2022.07.1
+      image: default
       resource_class: arm.xlarge
   darwin-amd64:
     macos:
@@ -311,6 +311,7 @@ jobs:
     - store_artifacts:
         path: coverage/coverage.html
 
+
   release:
     executor: linux-amd64
     steps:


Test patch:
diff --git a/pkg/executor/docker/executor_test.go b/pkg/executor/docker/executor_test.go
index 400b8a6536..0ad9f79e01 100644
--- a/pkg/executor/docker/executor_test.go
+++ b/pkg/executor/docker/executor_test.go
@@ -213,7 +213,7 @@ func (s *ExecutorTestSuite) TestDockerResourceLimitsCPU() {
 	// https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/using-cgroups-v2-to-control-distribution-of-cpu-time-for-applications_managing-monitoring-and-updating-the-kernel#proc_controlling-distribution-of-cpu-time-for-applications-by-adjusting-cpu-bandwidth_using-cgroups-v2-to-control-distribution-of-cpu-time-for-applications
 
 	task := mock.TaskBuilder().
-		Engine(dockermodels.NewDockerEngineBuilder("ubuntu").
+		Engine(dockermodels.NewDockerEngineBuilder("ubuntu:20.04").
 			WithEntrypoint("bash", "-c", "cat /sys/fs/cgroup/cpu.max").
 			Build()).
 		ResourcesConfig(models.NewResourcesConfigBuilder().CPU(CPU_LIMIT).Memory(MEBIBYTE_MEMORY_LIMIT).BuildOrDie()).
@@ -223,6 +223,7 @@ func (s *ExecutorTestSuite) TestDockerResourceLimitsCPU() {
 	require.NoError(s.T(), err)
 
 	values := strings.Fields(result)
+	s.Require().Len(values, 2, "the container reported CPU (%s) does not match the expected format", result)
 
 	numerator, err := strconv.Atoi(values[0])
 	require.NoError(s.T(), err)
@@ -255,7 +256,7 @@ func (s *ExecutorTestSuite) TestDockerResourceLimitsMemory() {
 	for _, p := range tests {
 		task := mock.TaskBuilder().
 			Engine(
-				dockermodels.NewDockerEngineBuilder("ubuntu").
+				dockermodels.NewDockerEngineBuilder("ubuntu:20.04").
 					WithEntrypoint("bash", "-c", "cat /sys/fs/cgroup/memory.max").
 					Build()).
 			ResourcesConfig(models.NewResourcesConfigBuilder().CPU(CPU_LIMIT).Memory(p.in).BuildOrDie()).
@@ -264,6 +265,8 @@ func (s *ExecutorTestSuite) TestDockerResourceLimitsMemory() {
 		result, err := s.runJobGetStdout(task, uuid.New().String())
 		require.NoError(s.T(), err)
 
+		s.Require().NotEmpty(result, "the container reported memory returned an empty string")
+
 		intVar, err := strconv.Atoi(strings.TrimSpace(result))
 		require.NoError(s.T(), err)