Skip to content

Commit

Permalink
improvement(core): default to new build staging mechanism
Browse files Browse the repository at this point in the history
We now default to using the new rsync-less build staging mechanism,
which previously had to be explicitly enabled with the
GARDEN_EXPERIMENTAL_BUILD_STAGE environment variable.

In turn, you can now switch _back_ to the older rsync-based mechanism
by setting `GARDEN_LEGACY_BUILD_STAGE=true` in your environment, in
case any unexpected issues come up. Please reach out to us if that
does happen and we'll try and fix any issues promptly.
  • Loading branch information
edvald committed Feb 3, 2021
1 parent 78e79c1 commit 5a21894
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ jobs:
description: The project environment to use
type: string
default: testing
environment:
GARDEN_EXPERIMENTAL_BUILD_STAGE: "true"
steps:
- checkout
- run: sudo apt-get update && sudo apt-get install rsync
Expand Down
2 changes: 1 addition & 1 deletion core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const gardenEnv = {
GARDEN_DISABLE_PORT_FORWARDS: env.get("GARDEN_DISABLE_PORT_FORWARDS").required(false).asBool(),
GARDEN_DISABLE_VERSION_CHECK: env.get("GARDEN_DISABLE_VERSION_CHECK").required(false).asBool(),
GARDEN_ENABLE_PROFILING: env.get("GARDEN_ENABLE_PROFILING").required(false).asBool(),
GARDEN_EXPERIMENTAL_BUILD_STAGE: env.get("GARDEN_EXPERIMENTAL_BUILD_STAGE").required(false).asBool(),
GARDEN_LEGACY_BUILD_STAGE: env.get("GARDEN_LEGACY_BUILD_STAGE").required(false).asBool(),
GARDEN_LOG_LEVEL: env.get("GARDEN_LOG_LEVEL").required(false).asString(),
GARDEN_LOGGER_TYPE: env.get("GARDEN_LOGGER_TYPE").required(false).asString(),
GARDEN_GE_SCHEDULED: env.get("GARDEN_GE_SCHEDULED").required(false).asBool(),
Expand Down
8 changes: 4 additions & 4 deletions core/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ export type ModuleActionMap = {
}

export interface GardenOpts {
experimentalBuildSync?: boolean
commandInfo?: CommandInfo
config?: ProjectConfig
disablePortForwards?: boolean
environmentName?: string
forceRefresh?: boolean
gardenDirPath?: string
legacyBuildSync?: boolean
log?: LogEntry
noEnterprise?: boolean
persistent?: boolean
Expand Down Expand Up @@ -362,9 +362,9 @@ export class Garden {
// Allow overriding variables
variables = { ...variables, ...(opts.variables || {}) }

const experimentalBuildSync =
opts.experimentalBuildSync === undefined ? gardenEnv.GARDEN_EXPERIMENTAL_BUILD_STAGE : opts.experimentalBuildSync
const buildDirCls = experimentalBuildSync ? BuildStaging : BuildDirRsync
const legacyBuildSync =
opts.legacyBuildSync === undefined ? gardenEnv.GARDEN_LEGACY_BUILD_STAGE : opts.legacyBuildSync
const buildDirCls = legacyBuildSync ? BuildDirRsync : BuildStaging
const buildDir = await buildDirCls.factory(projectRoot, gardenDirPath)
const workingCopyId = await getWorkingCopyId(gardenDirPath)

Expand Down
6 changes: 3 additions & 3 deletions core/test/unit/src/build-staging/build-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("BuildStaging", () => {
let buildStaging: BuildStaging

before(async () => {
garden = await makeGarden({ experimentalBuildSync: true })
garden = await makeGarden()
log = garden.log
buildStaging = garden.buildStaging
})
Expand Down Expand Up @@ -234,15 +234,15 @@ describe("BuildStaging", () => {
})
})

export function commonSyncTests(experimentalBuildSync: boolean) {
export function commonSyncTests(legacyBuildSync: boolean) {
let garden: TestGarden
let log: LogEntry
let buildStaging: BuildStaging
let tmpDir: TempDirectory
let tmpPath: string

before(async () => {
garden = await makeGarden({ experimentalBuildSync })
garden = await makeGarden({ legacyBuildSync })
log = garden.log
buildStaging = garden.buildStaging
})
Expand Down
2 changes: 1 addition & 1 deletion core/test/unit/src/build-staging/rsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("BuildStagingRsync", () => {
let garden: TestGarden

before(async () => {
garden = await makeTestGarden(projectRoot, { experimentalBuildSync: false })
garden = await makeTestGarden(projectRoot, { legacyBuildSync: true })
})

afterEach(async () => {
Expand Down

0 comments on commit 5a21894

Please sign in to comment.