diff --git a/cmd/cc-backend/main.go b/cmd/cc-backend/main.go index b0faa13..27c5c1e 100644 --- a/cmd/cc-backend/main.go +++ b/cmd/cc-backend/main.go @@ -26,6 +26,7 @@ import ( "github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/playground" "github.com/ClusterCockpit/cc-backend/internal/api" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/auth" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/graph" @@ -35,7 +36,6 @@ import ( "github.com/ClusterCockpit/cc-backend/internal/repository" "github.com/ClusterCockpit/cc-backend/internal/routerConfig" "github.com/ClusterCockpit/cc-backend/internal/util" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/runtimeEnv" "github.com/ClusterCockpit/cc-backend/pkg/schema" diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 0354a0f..96821a1 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -19,11 +19,11 @@ import ( "testing" "github.com/ClusterCockpit/cc-backend/internal/api" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/graph" "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/internal/repository" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" "github.com/gorilla/mux" diff --git a/internal/api/rest.go b/internal/api/rest.go index b447a21..ef44249 100644 --- a/internal/api/rest.go +++ b/internal/api/rest.go @@ -19,6 +19,7 @@ import ( "sync" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/auth" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/graph" @@ -27,7 +28,6 @@ import ( "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/internal/repository" "github.com/ClusterCockpit/cc-backend/internal/util" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" "github.com/gorilla/mux" diff --git a/pkg/archive/archive.go b/internal/archive/archive.go similarity index 100% rename from pkg/archive/archive.go rename to internal/archive/archive.go diff --git a/pkg/archive/archive_test.go b/internal/archive/archive_test.go similarity index 96% rename from pkg/archive/archive_test.go rename to internal/archive/archive_test.go index ac00ea1..aa2c32e 100644 --- a/pkg/archive/archive_test.go +++ b/internal/archive/archive_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/util" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) diff --git a/pkg/archive/clusterConfig.go b/internal/archive/clusterConfig.go similarity index 100% rename from pkg/archive/clusterConfig.go rename to internal/archive/clusterConfig.go diff --git a/pkg/archive/clusterConfig_test.go b/internal/archive/clusterConfig_test.go similarity index 93% rename from pkg/archive/clusterConfig_test.go rename to internal/archive/clusterConfig_test.go index a73f22f..5af8e93 100644 --- a/pkg/archive/clusterConfig_test.go +++ b/internal/archive/clusterConfig_test.go @@ -8,7 +8,7 @@ import ( "encoding/json" "testing" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" ) func TestClusterConfig(t *testing.T) { diff --git a/pkg/archive/fsBackend.go b/internal/archive/fsBackend.go similarity index 100% rename from pkg/archive/fsBackend.go rename to internal/archive/fsBackend.go diff --git a/pkg/archive/fsBackend_test.go b/internal/archive/fsBackend_test.go similarity index 100% rename from pkg/archive/fsBackend_test.go rename to internal/archive/fsBackend_test.go diff --git a/pkg/archive/json.go b/internal/archive/json.go similarity index 100% rename from pkg/archive/json.go rename to internal/archive/json.go diff --git a/pkg/archive/nodelist.go b/internal/archive/nodelist.go similarity index 100% rename from pkg/archive/nodelist.go rename to internal/archive/nodelist.go diff --git a/pkg/archive/nodelist_test.go b/internal/archive/nodelist_test.go similarity index 100% rename from pkg/archive/nodelist_test.go rename to internal/archive/nodelist_test.go diff --git a/pkg/archive/s3Backend.go b/internal/archive/s3Backend.go similarity index 100% rename from pkg/archive/s3Backend.go rename to internal/archive/s3Backend.go diff --git a/pkg/archive/testdata/archive/alex/cluster.json b/internal/archive/testdata/archive/alex/cluster.json similarity index 100% rename from pkg/archive/testdata/archive/alex/cluster.json rename to internal/archive/testdata/archive/alex/cluster.json diff --git a/pkg/archive/testdata/archive/emmy/1403/244/1608923076/data.json.gz b/internal/archive/testdata/archive/emmy/1403/244/1608923076/data.json.gz similarity index 100% rename from pkg/archive/testdata/archive/emmy/1403/244/1608923076/data.json.gz rename to internal/archive/testdata/archive/emmy/1403/244/1608923076/data.json.gz diff --git a/pkg/archive/testdata/archive/emmy/1403/244/1608923076/meta.json b/internal/archive/testdata/archive/emmy/1403/244/1608923076/meta.json similarity index 100% rename from pkg/archive/testdata/archive/emmy/1403/244/1608923076/meta.json rename to internal/archive/testdata/archive/emmy/1403/244/1608923076/meta.json diff --git a/pkg/archive/testdata/archive/emmy/1404/397/1609300556/data.json.gz b/internal/archive/testdata/archive/emmy/1404/397/1609300556/data.json.gz similarity index 100% rename from pkg/archive/testdata/archive/emmy/1404/397/1609300556/data.json.gz rename to internal/archive/testdata/archive/emmy/1404/397/1609300556/data.json.gz diff --git a/pkg/archive/testdata/archive/emmy/1404/397/1609300556/meta.json b/internal/archive/testdata/archive/emmy/1404/397/1609300556/meta.json similarity index 100% rename from pkg/archive/testdata/archive/emmy/1404/397/1609300556/meta.json rename to internal/archive/testdata/archive/emmy/1404/397/1609300556/meta.json diff --git a/pkg/archive/testdata/archive/emmy/cluster.json b/internal/archive/testdata/archive/emmy/cluster.json similarity index 100% rename from pkg/archive/testdata/archive/emmy/cluster.json rename to internal/archive/testdata/archive/emmy/cluster.json diff --git a/pkg/archive/testdata/archive/fritz/cluster.json b/internal/archive/testdata/archive/fritz/cluster.json similarity index 100% rename from pkg/archive/testdata/archive/fritz/cluster.json rename to internal/archive/testdata/archive/fritz/cluster.json diff --git a/pkg/archive/testdata/archive/version.txt b/internal/archive/testdata/archive/version.txt similarity index 100% rename from pkg/archive/testdata/archive/version.txt rename to internal/archive/testdata/archive/version.txt diff --git a/internal/graph/schema.resolvers.go b/internal/graph/schema.resolvers.go index f36e25a..70905bd 100644 --- a/internal/graph/schema.resolvers.go +++ b/internal/graph/schema.resolvers.go @@ -12,12 +12,12 @@ import ( "strings" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/graph/generated" "github.com/ClusterCockpit/cc-backend/internal/graph/model" "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/internal/repository" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) diff --git a/internal/graph/util.go b/internal/graph/util.go index 3e65b6c..f70a8bb 100644 --- a/internal/graph/util.go +++ b/internal/graph/util.go @@ -14,7 +14,7 @@ import ( "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" - // "github.com/ClusterCockpit/cc-backend/pkg/archive" + // "github.com/ClusterCockpit/cc-backend/internal/archive" ) const MAX_JOBS_FOR_ANALYSIS = 500 diff --git a/internal/importer/handleImport.go b/internal/importer/handleImport.go index c4d55ab..b5b8fe0 100644 --- a/internal/importer/handleImport.go +++ b/internal/importer/handleImport.go @@ -11,9 +11,9 @@ import ( "os" "strings" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/repository" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) diff --git a/internal/importer/importer_test.go b/internal/importer/importer_test.go index ce0d2e1..b4a178a 100644 --- a/internal/importer/importer_test.go +++ b/internal/importer/importer_test.go @@ -12,10 +12,10 @@ import ( "strings" "testing" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/importer" "github.com/ClusterCockpit/cc-backend/internal/repository" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" ) diff --git a/internal/importer/initDB.go b/internal/importer/initDB.go index 4b9abab..8b61dee 100644 --- a/internal/importer/initDB.go +++ b/internal/importer/initDB.go @@ -10,8 +10,8 @@ import ( "strings" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/repository" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) diff --git a/internal/metricdata/cc-metric-store.go b/internal/metricdata/cc-metric-store.go index e564db6..ab0647c 100644 --- a/internal/metricdata/cc-metric-store.go +++ b/internal/metricdata/cc-metric-store.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" ) diff --git a/internal/metricdata/influxdb-v2.go b/internal/metricdata/influxdb-v2.go index b95f07e..61ff930 100644 --- a/internal/metricdata/influxdb-v2.go +++ b/internal/metricdata/influxdb-v2.go @@ -13,7 +13,7 @@ import ( "strings" "time" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" influxdb2 "github.com/influxdata/influxdb-client-go/v2" diff --git a/internal/metricdata/metricdata.go b/internal/metricdata/metricdata.go index 74d4347..a55fa7c 100644 --- a/internal/metricdata/metricdata.go +++ b/internal/metricdata/metricdata.go @@ -11,8 +11,8 @@ import ( "math" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/lrucache" "github.com/ClusterCockpit/cc-backend/pkg/schema" diff --git a/internal/metricdata/prometheus.go b/internal/metricdata/prometheus.go index a8d9f39..db308dd 100644 --- a/internal/metricdata/prometheus.go +++ b/internal/metricdata/prometheus.go @@ -20,7 +20,7 @@ import ( "text/template" "time" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" promapi "github.com/prometheus/client_golang/api" diff --git a/internal/repository/job.go b/internal/repository/job.go index 33b619f..bf99479 100644 --- a/internal/repository/job.go +++ b/internal/repository/job.go @@ -14,9 +14,9 @@ import ( "sync" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/graph/model" "github.com/ClusterCockpit/cc-backend/internal/metricdata" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/lrucache" "github.com/ClusterCockpit/cc-backend/pkg/schema" diff --git a/internal/repository/stats.go b/internal/repository/stats.go index 33cafa0..56a6dc9 100644 --- a/internal/repository/stats.go +++ b/internal/repository/stats.go @@ -11,10 +11,10 @@ import ( "math" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" "github.com/ClusterCockpit/cc-backend/internal/graph/model" "github.com/ClusterCockpit/cc-backend/internal/metricdata" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" sq "github.com/Masterminds/squirrel" diff --git a/internal/repository/tags.go b/internal/repository/tags.go index 8dace03..85645ef 100644 --- a/internal/repository/tags.go +++ b/internal/repository/tags.go @@ -7,7 +7,7 @@ package repository import ( "strings" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" "github.com/ClusterCockpit/cc-backend/pkg/schema" sq "github.com/Masterminds/squirrel" diff --git a/tools/archive-manager/main.go b/tools/archive-manager/main.go index 1a80712..7b281b3 100644 --- a/tools/archive-manager/main.go +++ b/tools/archive-manager/main.go @@ -11,8 +11,8 @@ import ( "os" "time" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/internal/config" - "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" ) diff --git a/tools/archive-migration/clusterConfig.go b/tools/archive-migration/clusterConfig.go index 0f9f426..f905e4b 100644 --- a/tools/archive-migration/clusterConfig.go +++ b/tools/archive-migration/clusterConfig.go @@ -8,7 +8,7 @@ import ( "errors" "fmt" - "github.com/ClusterCockpit/cc-backend/pkg/archive" + "github.com/ClusterCockpit/cc-backend/internal/archive" "github.com/ClusterCockpit/cc-backend/pkg/schema" )