Skip to content

Commit

Permalink
Remove Dockerfile.enhanced (#978)
Browse files Browse the repository at this point in the history
* Add command to task def container

* Remove dockerfile.enhanced

* [DOP-4334]: Use npm ci

* Remove references to dockerfile.enhanced

* Reference main
  • Loading branch information
branberry authored Feb 7, 2024
1 parent d563250 commit 8215c54
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 133 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-prd-enhanced-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Rebuild Cache if New Snooty Parser Version
uses: mongodb/docs-worker-actions/rebuild-parse-cache@DOP-4294
env:
uses: mongodb/docs-worker-actions/rebuild-parse-cache@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKSPACE: ${{ github.workspace }}
WORKSPACE: ${{ github.workspace }}
3 changes: 1 addition & 2 deletions .github/workflows/deploy-stg-enhanced-worker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
paths: ["src/**", "cdk-infra/lib/constructs/worker/**", "Dockerfile.enhanced", "modules/**"]
paths: ['src/**', 'cdk-infra/lib/constructs/worker/**', 'Dockerfile', 'modules/**']
branches:
- 'main'
- 'integration'
Expand Down Expand Up @@ -29,4 +29,3 @@ jobs:
npm ci
npm run deploy:feature:stack -- -c env=dotcomstg -c customFeatureName=enhancedApp-dotcomstg auto-builder-stack-enhancedApp-dotcomstg-worker
npm run deploy:feature:stack -- -c env=stg -c customFeatureName=enhancedApp-stg auto-builder-stack-enhancedApp-stg-worker
2 changes: 1 addition & 1 deletion .github/workflows/update-feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
worker:
- 'src/!(cache-updater/**)/**'
- 'cdk-infra/lib/constructs/worker/**'
- 'Dockerfile.enhanced'
- 'Dockerfile'
- 'modules/**'
- name: Update Worker Stack
if: steps.filter.outputs.worker == 'true'
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ WORKDIR /home/docsworker-xlarge
COPY config config/
COPY package*.json ./
COPY tsconfig*.json ./
RUN npm install
RUN npm ci --legacy-peer-deps
COPY . ./
RUN npm run build

# install persistence module
RUN cd ./modules/persistence \
&& npm install \
&& npm ci --legacy-peer-deps \
&& npm run build

# Build modules
# OAS Page Builder
RUN cd ./modules/oas-page-builder \
&& npm install \
&& npm ci --legacy-peer-deps \
&& npm run build

# where repo work will happen
Expand Down Expand Up @@ -102,14 +102,14 @@ RUN mkdir -p modules/persistence && chmod 755 modules/persistence
COPY --from=ts-compiler --chown=docsworker-xlarge /home/docsworker-xlarge/modules/persistence/package*.json ./modules/persistence/
COPY --from=ts-compiler --chown=docsworker-xlarge /home/docsworker-xlarge/modules/persistence/dist ./modules/persistence/
ENV PERSISTENCE_MODULE_PATH=${WORK_DIRECTORY}/modules/persistence/index.js
RUN cd ./modules/persistence/ && ls && npm install
RUN cd ./modules/persistence/ && ls && npm ci --legacy-peer-deps

# OAS Page Builder module copy
# Create directory and add permissions to allow node module installation
RUN mkdir -p modules/oas-page-builder && chmod 755 modules/oas-page-builder
COPY --from=ts-compiler --chown=docsworker-xlarge /home/docsworker-xlarge/modules/oas-page-builder/package*.json ./modules/oas-page-builder/
COPY --from=ts-compiler --chown=docsworker-xlarge /home/docsworker-xlarge/modules/oas-page-builder/dist ./modules/oas-page-builder/
RUN cd ./modules/oas-page-builder/ && npm install
RUN cd ./modules/oas-page-builder/ && npm ci --legacy-peer-deps

# Needed for OAS Page Builder module in shared.mk
ENV REDOC_PATH=${WORK_DIRECTORY}/redoc/cli/index.js
Expand Down
120 changes: 0 additions & 120 deletions Dockerfile.enhanced

This file was deleted.

2 changes: 1 addition & 1 deletion cdk-infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To verify the CloudFormation is being generated successfully, you can use the `c
npm run cdk synth -- -c enhanced=true -c customFeatureName=enhancedApp > cdk.out/template.yaml
```

Make sure to update your `~/.aws/credentials` file. The `enhanced` context variable, if set to true, will use the `Dockerfile.enhanced` dockerfile instead of the standard one. The `featureName` context variable is used to provide a different name for a custom stack other than the branch name. In the future for feature branches, the context variable `isFeature` will be used to use the Git branch name and append that to the stack name.
Make sure to update your `~/.aws/credentials` file. The `enhanced` context variable, if set to true, will use the `Dockerfile` dockerfile instead of the standard one. The `featureName` context variable is used to provide a different name for a custom stack other than the branch name. In the future for feature branches, the context variable `isFeature` will be used to use the Git branch name and append that to the stack name.

## MongoDB Enhanced Infrastructure Commands

Expand Down
2 changes: 1 addition & 1 deletion cdk-infra/lib/constructs/worker/worker-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class WorkerConstruct extends Construct {
executionRole.addToPolicy(executionRoleSsmPolicy);

const containerProps: AssetImageProps = {
file: isEnhanced() ? 'Dockerfile.enhanced' : undefined,
buildArgs: {
NPM_BASE_64_AUTH: dockerEnvironment.NPM_BASE_64_AUTH,
NPM_EMAIL: dockerEnvironment.NPM_EMAIL,
Expand Down Expand Up @@ -96,6 +95,7 @@ export class WorkerConstruct extends Construct {
taskDefinition.addContainer('workerImage', {
image: ContainerImage.fromAsset(path.join(__dirname, '../../../../'), containerProps),
environment: dockerEnvironment,
command: ['node', '--enable-source-maps', 'enhanced/enhancedApp.js'],
logging: LogDrivers.awsLogs({
streamPrefix: 'autobuilderworker',
logGroup: taskDefLogGroup,
Expand Down

0 comments on commit 8215c54

Please sign in to comment.