From 5e741a1fd67d69c4cd1e596c2d94e9f975c96c34 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatt Date: Tue, 15 Oct 2024 14:26:48 +0530 Subject: [PATCH 1/3] Added QAT configs with experimental flag. Signed-off-by: Utkarsh Bhatt --- microceph/ceph/config.go | 30 +++++++++++++++---- .../cmd/microceph/cluster_config_reset.go | 5 ++++ microceph/cmd/microceph/cluster_config_set.go | 5 ++++ microceph/constants/constants.go | 1 + 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/microceph/ceph/config.go b/microceph/ceph/config.go index 6b14092e..765b8d03 100644 --- a/microceph/ceph/config.go +++ b/microceph/ceph/config.go @@ -22,8 +22,9 @@ import ( type ClusterConfigPermission string const ( - ClusterConfigRO ClusterConfigPermission = "read_only" - ClusterConfigRW ClusterConfigPermission = "read_write" + ClusterConfigRO ClusterConfigPermission = "read_only" // Read Only + ClusterConfigRW ClusterConfigPermission = "read_write" // Read/ Write + ClusterConfigEXPRW ClusterConfigPermission = "exp_read_write" // Read/ Write but experimental features ) type ClusterConfigDefinition struct { @@ -84,6 +85,10 @@ func GetConstConfigTable() ConfigTable { "rgw_swift_versioning_enabled": {"global", ClusterConfigRW, []string{"rgw"}}, "rgw_swift_enforce_content_length": {"global", ClusterConfigRW, []string{"rgw"}}, "rgw_swift_custom_header": {"global", ClusterConfigRW, []string{"rgw"}}, + // RGW QAT config keys + "qat_compressor_enabled": {"client.radosgw.gateway", ClusterConfigEXPRW, []string{"rgw"}}, + "openssl_engine_opts": {"client.radosgw.gateway", ClusterConfigEXPRW, []string{"rgw"}}, + "plugin_crypto_accelerator": {"client.radosgw.gateway", ClusterConfigEXPRW, []string{"rgw"}}, } } @@ -160,10 +165,11 @@ func RemoveConfigItem(c types.Config) error { return err } + config := GetConstConfigTable()[c.Key] args := []string{ "config", "rm", - GetConstConfigTable()[c.Key].Who, + config.Who, c.Key, } @@ -172,6 +178,12 @@ func RemoveConfigItem(c types.Config) error { return err } + if config.Permission == ClusterConfigEXPRW { + err := fmt.Errorf(constants.ExperimentalConfigErrTemplate, "reset", c.Key) + logger.Warn(err.Error()) + return err + } + return nil } @@ -207,10 +219,11 @@ func ListConfigs() (types.Configs, error) { // ****** Helper Functions ******// func setConfigItem(c types.Config) error { + config := GetConstConfigTable()[c.Key] args := []string{ "config", "set", - GetConstConfigTable()[c.Key].Who, + config.Who, c.Key, c.Value, "-f", @@ -222,6 +235,12 @@ func setConfigItem(c types.Config) error { return err } + if config.Permission == ClusterConfigEXPRW { + err := fmt.Errorf(constants.ExperimentalConfigErrTemplate, "set", c.Key) + logger.Warn(err.Error()) + return err + } + return nil } @@ -233,7 +252,8 @@ func canSetConfig(key string) (bool, error) { return false, err } - if config.Permission != ClusterConfigRW { + // check if write operation is permitted. + if !strings.Contains(string(config.Permission), "write") { err := fmt.Errorf("requested key %s does not support write operation", key) logger.Warnf(err.Error()) return false, err diff --git a/microceph/cmd/microceph/cluster_config_reset.go b/microceph/cmd/microceph/cluster_config_reset.go index c88f5bcd..d27ee2a2 100644 --- a/microceph/cmd/microceph/cluster_config_reset.go +++ b/microceph/cmd/microceph/cluster_config_reset.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "strings" "github.com/canonical/microcluster/v2/microcluster" "github.com/spf13/cobra" @@ -55,6 +56,10 @@ func (c *cmdClusterConfigReset) Run(cmd *cobra.Command, args []string) error { err = client.ClearConfig(context.Background(), cli, req) if err != nil { + if strings.Contains(err.Error(), "performed on experimental config") { + fmt.Println(err.Error()) + return nil + } return err } diff --git a/microceph/cmd/microceph/cluster_config_set.go b/microceph/cmd/microceph/cluster_config_set.go index 670f2354..e2414a50 100644 --- a/microceph/cmd/microceph/cluster_config_set.go +++ b/microceph/cmd/microceph/cluster_config_set.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "strings" "github.com/canonical/microcluster/v2/microcluster" "github.com/spf13/cobra" @@ -56,6 +57,10 @@ func (c *cmdClusterConfigSet) Run(cmd *cobra.Command, args []string) error { err = client.SetConfig(context.Background(), cli, req) if err != nil { + if strings.Contains(err.Error(), "performed on experimental config") { + fmt.Println(err.Error()) + return nil + } return err } diff --git a/microceph/constants/constants.go b/microceph/constants/constants.go index 9437fb5c..4dafd9d7 100644 --- a/microceph/constants/constants.go +++ b/microceph/constants/constants.go @@ -20,6 +20,7 @@ const LoopSpecId = "loop," const DevicePathPrefix = "/dev/disk/by-id/" const RgwSockPattern = "client.radosgw.gateway" const CliForcePrompt = "If you understand the *RISK* and you're *ABSOLUTELY CERTAIN* that is what you want, pass --yes-i-really-mean-it." +const ExperimentalConfigErrTemplate = "WARNING: An operation (%s) was performed on experimental config (%s)" // Path and filename constants From 704dfaf646aef44047173c886112dd0ebb6a6af1 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatt Date: Tue, 15 Oct 2024 14:28:52 +0530 Subject: [PATCH 2/3] Build snap from noble proposed Signed-off-by: Utkarsh Bhatt --- snap/snapcraft.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7a5ab9e8..a09b18a3 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -10,6 +10,14 @@ description: |- confinement: strict +package-repositories: + - type: apt + url: http://archive.ubuntu.com/ubuntu/ + suites: [noble-proposed] + components: [main, universe, restricted, multiverse] + key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C + priority: always + plugs: load-rbd: interface: kernel-module-load @@ -212,6 +220,7 @@ parts: - lib/*/libboost_program_options.so* - lib/*/libboost_python312.so* - lib/*/libboost_thread.so* + - lib/*/libboost_url.so* - lib/*/libcephfs.so* - lib/*/libcephsqlite.so* - lib/*/libcurl-gnutls.so* From 27c2db4caae97249f58417563e2c4bbd7d44396e Mon Sep 17 00:00:00 2001 From: utkarsh bhatt Date: Tue, 12 Nov 2024 20:45:09 +0530 Subject: [PATCH 3/3] Pick ceph packages from experimental PPA Signed-off-by: utkarsh bhatt --- snap/snapcraft.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a09b18a3..38b3db0a 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -12,10 +12,7 @@ confinement: strict package-repositories: - type: apt - url: http://archive.ubuntu.com/ubuntu/ - suites: [noble-proposed] - components: [main, universe, restricted, multiverse] - key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C + ppa: lmlogiudice/ceph-1920-qatsys priority: always plugs: