Skip to content

Commit 138892f

Browse files
committed
Remove backend and ref to s3
1 parent 2d7ae0c commit 138892f

File tree

27 files changed

+166
-1908
lines changed

27 files changed

+166
-1908
lines changed

benchmark/cmd/main.go

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"github.com/base/base-bench/benchmark/config"
1010
"github.com/base/base-bench/benchmark/flags"
1111
"github.com/base/base-bench/runner"
12-
"github.com/base/base-bench/runner/aws"
13-
"github.com/base/base-bench/runner/benchmark"
1412
"github.com/base/base-bench/runner/importer"
1513
"github.com/urfave/cli/v2"
1614

@@ -44,16 +42,9 @@ func main() {
4442
Name: "import-runs",
4543
Flags: cliapp.ProtectFlags(flags.ImportRunsFlags),
4644
Action: ImportMain(Version),
47-
Usage: "import runs from metadata file, URL, or S3",
48-
Description: "Import benchmark runs from local metadata.json, remote URL, or S3 bucket into existing output metadata.json. Use --s3-bucket and --s3-directory to import from S3, or provide a file/URL as argument. Use --src-tag and --dest-tag to apply tags to runs, or use interactive mode.",
49-
ArgsUsage: "[metadata-file-or-url] (optional when using S3)",
50-
},
51-
{
52-
Name: "export-to-cloud",
53-
Flags: cliapp.ProtectFlags(flags.ExportFlags),
54-
Action: ExportMain(Version),
55-
Usage: "export output directory to S3",
56-
Description: "Export the entire output directory to AWS S3 bucket and sync with remote metadata.json.",
45+
Usage: "import runs from metadata file, URL",
46+
Description: "Import benchmark runs from local metadata.json, remote URL into existing output metadata.json. Use --src-tag and --dest-tag to apply tags to runs, or use interactive mode.",
47+
ArgsUsage: "[metadata-file-or-url]",
5748
},
5849
}
5950
app.Flags = flags.Flags
@@ -95,19 +86,10 @@ func ImportMain(version string) cli.ActionFunc {
9586

9687
service := importer.NewService(cfg, l)
9788

98-
// Load source metadata - from S3 if bucket is specified, otherwise from file/URL
99-
var srcMetadata *benchmark.RunGroup
100-
var err error
101-
if cfg.S3Bucket() != "" {
102-
srcMetadata, err = service.LoadSourceMetadataFromS3()
103-
if err != nil {
104-
return fmt.Errorf("failed to load source metadata from S3: %w", err)
105-
}
106-
} else {
107-
srcMetadata, err = service.LoadSourceMetadata(cfg.SourceFile())
108-
if err != nil {
109-
return fmt.Errorf("failed to load source metadata: %w", err)
110-
}
89+
// Load source metadata from file/URL
90+
srcMetadata, err := service.LoadSourceMetadata(cfg.SourceFile())
91+
if err != nil {
92+
return fmt.Errorf("failed to load source metadata: %w", err)
11193
}
11294

11395
// Load destination metadata
@@ -181,13 +163,8 @@ func ImportMain(version string) cli.ActionFunc {
181163
fmt.Printf(" • Imported: %d runs\n", result.ImportedRuns)
182164
fmt.Printf(" • Total runs: %d\n", result.TotalRuns)
183165

184-
// Show if we downloaded files from URL or S3
185-
if cfg.S3Bucket() != "" {
186-
fmt.Printf(" • Downloaded output files from S3 bucket: %s\n", cfg.S3Bucket())
187-
if cfg.S3Directory() != "" && cfg.S3Directory() != "." {
188-
fmt.Printf(" • S3 directory: %s\n", cfg.S3Directory())
189-
}
190-
} else if strings.HasPrefix(cfg.SourceFile(), "http://") || strings.HasPrefix(cfg.SourceFile(), "https://") {
166+
// Show if we downloaded files from URL
167+
if strings.HasPrefix(cfg.SourceFile(), "http://") || strings.HasPrefix(cfg.SourceFile(), "https://") {
191168
fmt.Printf(" • Downloaded output files from URL\n")
192169
}
193170

@@ -208,33 +185,3 @@ func ImportMain(version string) cli.ActionFunc {
208185
return nil
209186
}
210187
}
211-
212-
func ExportMain(version string) cli.ActionFunc {
213-
return func(cliCtx *cli.Context) error {
214-
cfg := config.NewExportCmdConfig(cliCtx)
215-
if err := cfg.Check(); err != nil {
216-
return fmt.Errorf("invalid CLI flags: %w", err)
217-
}
218-
219-
l := oplog.NewLogger(oplog.AppOut(cliCtx), oplog.DefaultCLIConfig())
220-
oplog.SetGlobalLogHandler(l.Handler())
221-
222-
// Initialize S3 service
223-
s3Service, err := aws.NewS3Service(cfg.S3Bucket(), l)
224-
if err != nil {
225-
return fmt.Errorf("failed to initialize S3 service: %w", err)
226-
}
227-
228-
// Export output directory to S3
229-
err = s3Service.ExportOutputDirectory(cfg.OutputDir())
230-
if err != nil {
231-
return fmt.Errorf("failed to export output directory to S3: %w", err)
232-
}
233-
234-
fmt.Printf("✅ Export completed successfully!\n")
235-
fmt.Printf(" • Output directory: %s\n", cfg.OutputDir())
236-
fmt.Printf(" • S3 bucket: %s\n", cfg.S3Bucket())
237-
238-
return nil
239-
}
240-
}

benchmark/config/export_config.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

benchmark/config/import_config.go

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import (
1010

1111
// ImportCmdConfig holds configuration for the import-runs command
1212
type ImportCmdConfig struct {
13-
sourceFile string
14-
srcTag *TagConfig
15-
destTag *TagConfig
16-
noConfirm bool
17-
outputDir string
18-
s3Bucket string
19-
s3Directory string
13+
sourceFile string
14+
srcTag *TagConfig
15+
destTag *TagConfig
16+
noConfirm bool
17+
outputDir string
2018
}
2119

2220
// TagConfig represents a key-value tag
@@ -28,11 +26,9 @@ type TagConfig struct {
2826
// NewImportCmdConfig creates a new import command configuration from CLI context
2927
func NewImportCmdConfig(cliCtx *cli.Context) *ImportCmdConfig {
3028
cfg := &ImportCmdConfig{
31-
sourceFile: cliCtx.Args().First(), // First positional argument
32-
noConfirm: cliCtx.Bool(flags.NoConfirmFlagName),
33-
outputDir: cliCtx.String(flags.OutputDirFlagName),
34-
s3Bucket: cliCtx.String(flags.S3BucketFlagName),
35-
s3Directory: cliCtx.String(flags.S3DirectoryFlagName),
29+
sourceFile: cliCtx.Args().First(), // First positional argument
30+
noConfirm: cliCtx.Bool(flags.NoConfirmFlagName),
31+
outputDir: cliCtx.String(flags.OutputDirFlagName),
3632
}
3733

3834
// Parse src-tag flag
@@ -85,36 +81,13 @@ func (c *ImportCmdConfig) OutputDir() string {
8581
return c.outputDir
8682
}
8783

88-
// S3Bucket returns the S3 bucket name
89-
func (c *ImportCmdConfig) S3Bucket() string {
90-
return c.s3Bucket
91-
}
92-
93-
// S3Directory returns the S3 directory/prefix
94-
func (c *ImportCmdConfig) S3Directory() string {
95-
return c.s3Directory
96-
}
97-
9884
// Check validates the import configuration
9985
func (c *ImportCmdConfig) Check() error {
100-
// Check if we're using S3 mode
101-
if c.s3Bucket != "" {
102-
// S3 mode: bucket is required, source file becomes optional (defaults to metadata.json)
103-
if c.outputDir == "" {
104-
return fmt.Errorf("output directory is required")
105-
}
106-
// If no source file specified in S3 mode, default to metadata.json
107-
if c.sourceFile == "" {
108-
c.sourceFile = "metadata.json"
109-
}
110-
} else {
111-
// Non-S3 mode: source file is required
112-
if c.sourceFile == "" {
113-
return fmt.Errorf("source file path or URL is required")
114-
}
115-
if c.outputDir == "" {
116-
return fmt.Errorf("output directory is required")
117-
}
86+
if c.sourceFile == "" {
87+
return fmt.Errorf("source file path or URL is required")
88+
}
89+
if c.outputDir == "" {
90+
return fmt.Errorf("output directory is required")
11891
}
11992
return nil
12093
}

benchmark/flags/export_flags.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

benchmark/flags/flags.go

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ func prefixEnvVars(name string) []string {
1515
}
1616

1717
const (
18-
ConfigFlagName = "config"
19-
RootDirFlagName = "root-dir"
20-
OutputDirFlagName = "output-dir"
21-
EnableS3FlagName = "enable-s3"
22-
S3BucketFlagName = "s3-bucket"
23-
TxFuzzBinFlagName = "tx-fuzz-bin"
24-
ProxyPortFlagName = "proxy-port"
25-
BenchmarkRunIDFlagName = "benchmark-run-id"
18+
ConfigFlagName = "config"
19+
RootDirFlagName = "root-dir"
20+
OutputDirFlagName = "output-dir"
21+
TxFuzzBinFlagName = "tx-fuzz-bin"
22+
ProxyPortFlagName = "proxy-port"
23+
BenchmarkRunIDFlagName = "benchmark-run-id"
2624
MachineTypeFlagName = "machine-type"
2725
MachineProviderFlagName = "machine-provider"
2826
MachineRegionFlagName = "machine-region"
@@ -70,19 +68,6 @@ var (
7068
EnvVars: prefixEnvVars("PROXY_PORT"),
7169
}
7270

73-
EnableS3Flag = &cli.BoolFlag{
74-
Name: EnableS3FlagName,
75-
Usage: "Enable S3 upload of benchmark results",
76-
EnvVars: prefixEnvVars("ENABLE_S3"),
77-
Value: false,
78-
}
79-
80-
S3BucketFlag = &cli.StringFlag{
81-
Name: S3BucketFlagName,
82-
Usage: "S3 bucket name for storing benchmark results",
83-
EnvVars: prefixEnvVars("S3_BUCKET"),
84-
}
85-
8671
BenchmarkRunIDFlag = &cli.StringFlag{
8772
Name: BenchmarkRunIDFlagName,
8873
Usage: "Custom benchmark run ID (auto-generated if not provided)",
@@ -124,8 +109,6 @@ var RunFlags = []cli.Flag{
124109
OutputDirFlag,
125110
TxFuzzBinFlag,
126111
ProxyPortFlag,
127-
EnableS3Flag,
128-
S3BucketFlag,
129112
BenchmarkRunIDFlag,
130113
MachineTypeFlag,
131114
MachineProviderFlag,

benchmark/flags/import_flags.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import (
55
)
66

77
const (
8-
SrcTagFlagName = "src-tag"
9-
DestTagFlagName = "dest-tag"
10-
NoConfirmFlagName = "no-confirm"
11-
S3DirectoryFlagName = "s3-directory"
8+
SrcTagFlagName = "src-tag"
9+
DestTagFlagName = "dest-tag"
10+
NoConfirmFlagName = "no-confirm"
1211
)
1312

1413
var (
@@ -27,11 +26,6 @@ var (
2726
Usage: "Skip confirmation prompts",
2827
Value: false,
2928
}
30-
31-
S3DirectoryFlag = &cli.StringFlag{
32-
Name: S3DirectoryFlagName,
33-
Usage: "S3 directory/prefix to download from (use '.' for root directory)",
34-
}
3529
)
3630

3731
// ImportRunsFlags contains the list of flags for the import-runs command
@@ -40,6 +34,4 @@ var ImportRunsFlags = []cli.Flag{
4034
SrcTagFlag,
4135
DestTagFlag,
4236
NoConfirmFlag,
43-
S3BucketFlag,
44-
S3DirectoryFlag,
4537
}

report/backend/Dockerfile

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)