A pipeline was written with the input bucket path, output path, model hyperparameters, and the GPU device count hard-coded as literals inside the stage functions. The team now needs to run the identical pipeline against a small sample in a development environment and against the full dataset in production, and they want a clean way to promote the same code between the two without editing source each time. Which design change most directly supports running one codebase across both environments?
- ADuplicate the pipeline into a development copy and a production copy, each carrying its own hard-coded literals, and keep the two in sync by hand when logic changes.
- BAdd conditional branches throughout the code that check the machine hostname and choose the development or production literals based on which host the pipeline detects it is running on.
- CExternalise the environment-specific values into configuration supplied at run time, so the same code reads its paths, hyperparameters, and device count from a config file or environment variables per environment. Correct
- DMove the hard-coded literals to the top of each stage function as module-level constants so they are at least grouped together and easier to locate before each run.
Why A is wrong: Two copies let each environment keep its own values, which appears to solve the immediate need, but it splits one pipeline into two divergent codebases that drift apart and must be reconciled manually on every change.
Why B is wrong: Hostname branching keeps everything in one file and switches values automatically, which seems convenient, but it bakes both environments' settings into the source, scatters fragile conditionals, and breaks the moment a new environment or host appears.
Why C is correct: Lifting the paths, hyperparameters, and device count out of the source into run-time configuration means a single codebase behaves differently per environment purely through the config it is given, which is exactly what lets the same code be promoted unchanged from development to production.
Why D is wrong: Grouping the literals as constants improves readability, which is a minor gain, but the values still live in source and must be edited and redeployed to switch environments, so it does not enable running one codebase across both.