-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gaius <[email protected]>
- Loading branch information
Showing
16 changed files
with
552 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Check Size | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
env: | ||
GO_VERSION: '1.21' | ||
|
||
jobs: | ||
check_size: | ||
name: Check Size | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Check large files | ||
uses: actionsdesk/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filesizelimit: "1048576" | ||
exclusionPatterns: | | ||
deploy/helm-charts | ||
manager/console | ||
client-rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CodeQL Analysis | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
pull_request: | ||
branches: [main, release-*] | ||
paths-ignore: ['**.md', '**.png', '**.jpg', '**.svg', '**/docs/**'] | ||
schedule: | ||
- cron: '0 4 * * *' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [go] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,22 @@ This repository includes performance test tools of dragonfly. | |
|
||
Provide dragonfly performance test solution and related metics. | ||
|
||
- [Scheduler GRPC performance tests](benchmarks/scheduler/README.md) | ||
## Community | ||
|
||
Join the conversation and help the community. | ||
|
||
- **Slack Channel**: [#dragonfly](https://cloud-native.slack.com/messages/dragonfly/) on [CNCF Slack](https://slack.cncf.io/) | ||
- **Discussion Group**: <[email protected]> | ||
- **Developer Group**: <[email protected]> | ||
- **Github Discussions**: [Dragonfly Discussion Forum](https://github.com/dragonflyoss/Dragonfly2/discussions) | ||
- **Twitter**: [@dragonfly_oss](https://twitter.com/dragonfly_oss) | ||
- **DingTalk**: [22880028764](https://qr.dingtalk.com/action/joingroup?code=v1,k1,pkV9IbsSyDusFQdByPSK3HfCG61ZCLeb8b/lpQ3uUqI=&_dt_no_comment=1&origin=11) | ||
|
||
## Contributing | ||
|
||
You should check out our | ||
[CONTRIBUTING](https://github.com/dragonflyoss/Dragonfly2/blob/main/CONTRIBUTING.md) and develop the project together. | ||
|
||
## Code of Conduct | ||
|
||
Please refer to our [Code of Conduct](https://github.com/dragonflyoss/Dragonfly2/blob/main/CODE_OF_CONDUCT.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2024 The Dragonfly Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dfbench | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/dragonflyoss/perf-tests/benchmark/pkg/config" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// dragonflyCmd represents the benchmark command for dragonfly. | ||
var dragonflyCmd = &cobra.Command{ | ||
Use: "dragonfly [flags]", | ||
Short: "A command line tool for benchmarking Dragonfly", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout) | ||
defer cancel() | ||
|
||
logrus.Infof("running dragonfly benchmark %d times", cfg.Dragonfly.Number) | ||
return runDragonfly(ctx, cfg) | ||
}, | ||
} | ||
|
||
// init initializes dragonfly command. | ||
func init() { | ||
flags := dragonflyCmd.Flags() | ||
flags.Uint32VarP(&cfg.Dragonfly.Number, "number", "n", cfg.Dragonfly.Number, "Specify the number of times to run the dragonfly benchmark") | ||
|
||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache dragonfly flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runDragonfly runs the dragonfly benchmark. | ||
func runDragonfly(ctx context.Context, cfg *config.Config) error { | ||
// TODO: Add dragonfly benchmark logic here. | ||
return nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2024 The Dragonfly Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dfbench | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/dragonflyoss/perf-tests/benchmark/pkg/config" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// nydusCmd represents the benchmark command for nydus. | ||
var nydusCmd = &cobra.Command{ | ||
Use: "nydus [flags]", | ||
Short: "A command line tool for benchmarking Nydus", | ||
Args: cobra.NoArgs, | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout) | ||
defer cancel() | ||
|
||
logrus.Infof("running nydus benchmark %d times", cfg.Nydus.Number) | ||
return runNydus(ctx, cfg) | ||
}, | ||
} | ||
|
||
// init initializes nydus command. | ||
func init() { | ||
flags := nydusCmd.Flags() | ||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(fmt.Errorf("bind cache nydus flags to viper: %w", err)) | ||
} | ||
} | ||
|
||
// runNydus runs the nydus benchmark. | ||
func runNydus(ctx context.Context, cfg *config.Config) error { | ||
// TODO: Add nydus benchmark logic here. | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright 2024 The Dragonfly Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dfbench | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/dragonflyoss/perf-tests/benchmark/pkg/config" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
// Initialize default dfbench config. | ||
var cfg = config.NewConfig() | ||
|
||
// rootCmd represents the benchmark command. | ||
var rootCmd = &cobra.Command{ | ||
Use: "dfbench", | ||
Short: "A command line tool for benchmarking Dragonfly", | ||
Args: cobra.ExactArgs(1), | ||
DisableAutoGenTag: true, | ||
SilenceUsage: true, | ||
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
logrus.Debug("dfbench is running") | ||
|
||
// Set the configured log level | ||
if level, err := logrus.ParseLevel(cfg.LogLevel); err == nil { | ||
logrus.SetLevel(level) | ||
} | ||
logrus.Debug("dfbench log initialized") | ||
return nil | ||
}, | ||
} | ||
|
||
// Execute adds all child commands to the root command and sets flags appropriately. | ||
// This is called by main.main(). It only needs to happen once to the rootCmd. | ||
func Execute() { | ||
if err := rootCmd.Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func init() { | ||
// Bind more cache specific persistent flags. | ||
flags := rootCmd.PersistentFlags() | ||
flags.DurationVar(&cfg.Timeout, "timeout", cfg.Timeout, "Specify the timeout for benchmarking") | ||
flags.StringVar(&cfg.LogLevel, "log-level", cfg.LogLevel, "Specify the log level [debug, info, warn, error, fatal, panic], default is info") | ||
|
||
// Bind common flags. | ||
if err := viper.BindPFlags(flags); err != nil { | ||
panic(err) | ||
} | ||
|
||
// Add sub command. | ||
rootCmd.AddCommand(dragonflyCmd) | ||
rootCmd.AddCommand(nydusCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2024 The Dragonfly Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import "github.com/dragonflyoss/perf-tests/benchmark/cmd/dfbench" | ||
|
||
func main() { | ||
dfbench.Execute() | ||
} |
Oops, something went wrong.