Skip to content

Conversation

@danyrouh
Copy link
Collaborator

@danyrouh danyrouh commented Nov 25, 2025

Here's the updated PR description:


PR: MetaOptimize CLI Consolidation and Docker Deployment

Summary

This PR consolidates the CLI implementation and prepares MetaOptimize for Docker containerization and MSRHub deployment. The unified CLI supports all four problem types through a single entry point using the existing CommandLineParser-based CliOptions class.

Changes

CLI Consolidation

  • Unified CliOptions.cs with parameters for all problem types (TrafficEngineering, BinPacking, PIFO, FailureAnalysis)
  • Removed duplicate implementations: deleted CliArgs.cs and TESimpleRunner.cs
  • Added ProblemType enum to route to the correct runner from Program.cs
  • Updated all runners (BPRunner, PIFORunner, FailureAnalysisRunner, TERunner) to use CliOptions.Instance
  • Fixed parameter naming: --ffMethod for First-Fit method selection, --topologyFile for topology input
  • Added comprehensive XML documentation across all runner files

Tests

  • Added CliParameterCombinationTests.cs with 45 unit tests covering:
    • Problem type and solver combinations (all 8 combinations)
    • Traffic Engineering heuristics (Pop, DemandPinning, ExpectedPop, PopDp, ModifiedDp, etc.)
    • Traffic Engineering methods (Direct, Search, FindFeas, Random, HillClimber, SimulatedAnnealing)
    • Traffic Engineering inner encoding (KKT, PrimalDual) and demand lists
    • Traffic Engineering clustering options (toggle, cluster counts, versions)
    • Bin Packing FFD methods with various bin/item configurations
    • Bin Packing dimensions and capacity parsing
    • PIFO packet, rank, queue, and AIFO parameter combinations
    • Failure Analysis failure counts, paths, and probability thresholds
    • Common options (timeout, threads, seed, verbose, debug)
    • Full configuration tests for each problem type
    • Smoke tests for runner initialization (BP, PIFO, TE)
  • Added CliOptionsTests.cs with 20 unit tests covering:
    • Default value validation
    • Parameter parsing for all problem types
    • Enum parsing (FFDMethodChoice, SolverChoice, MethodChoice, Heuristic)
    • Short option flags (-f, -h, -c, -v)
    • Integration tests for runner setup

Usage Examples


Traffic Engineering

dotnet run --project MetaOptimize.Cli -- --problemType TrafficEngineering --topologyFile simple.json --heuristic Pop --solver Gurobi

Bin Packing

dotnet run --project MetaOptimize.Cli -- --problemType BinPacking --numBins 6 --numDemands 9 --ffMethod FFDSum

PIFO

dotnet run --project MetaOptimize.Cli -- --problemType PIFO --numPackets 18 --maxRank 8 --numQueues 4

Failure Analysis

dotnet run --project MetaOptimize.Cli -- --problemType FailureAnalysis --maxNumFailures 1 --useDefaultTopology true

Files Changed

File Change
CliOptions.cs Added ProblemType, BinPacking, PIFO, FailureAnalysis parameters
Program.cs Updated to use CommandLineParser, routes by ProblemType
BPRunner.cs Refactored to use CliOptions.Instance
PIFORunner.cs Refactored to use CliOptions.Instance
FailureAnalysisRunner.cs Refactored to use CliOptions.Instance
TERunner.cs Simplified, removed TESimpleRunner dependency
CliArgs.cs Deleted
TESimpleRunner.cs Deleted
CliOptionsTests.cs Added - 20 unit tests

Testing


Run all CLI tests

dotnet test MetaOptimize.Test --filter "FullyQualifiedName~CliOptionsTests"

Run specific problem type locally

dotnet run --project MetaOptimize.Cli -- --problemType BinPacking --verbose

Notes

  • Gurobi runs single-threaded by default (--gurobithreads 1) for deterministic results
  • All original CliOptions parameters for Traffic Engineering are preserved
  • Docker deployment requires Gurobi license file or token server access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants