feat: add support for EC2 Graviton ARM64#41126
feat: add support for EC2 Graviton ARM64#41126Lavanyajc wants to merge 3 commits intoappsmithorg:releasefrom
Conversation
WalkthroughThe changes introduce a default base image in the Dockerfile, update the docker-compose file to use a multi-architecture release image compatible with EC2 Graviton instances, and add a new Node.js script to simulate restoring a backup from an S3 URL. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant restore-from-s3.js
participant TempFile
participant Shell
User->>restore-from-s3.js: Run with S3 URL argument
restore-from-s3.js->>restore-from-s3.js: Validate S3 URL
alt Invalid URL
restore-from-s3.js->>User: Log error & exit
else Valid URL
restore-from-s3.js->>TempFile: Write "fake backup content"
restore-from-s3.js->>Shell: Simulate mongorestore using temp file
Shell->>restore-from-s3.js: Output result
restore-from-s3.js->>User: Log completion
end
Estimated code review effort2 (~15 minutes) Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
deploy/docker/fs/opt/bin/restore-from-s3.js (1)
28-30: Minor suggestion: Consider command structure consistency.The simulated
mongorestorecommand could be more realistic by matching actual restore patterns used elsewhere in the codebase.- execSync(`echo Simulated mongorestore --gzip --archive=${localFile}`, { + execSync(`echo "Simulated: mongorestore --gzip --archive=${localFile}"`, { stdio: "inherit" });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Dockerfile(1 hunks)deploy/docker/docker-compose.yml(2 hunks)deploy/docker/fs/opt/bin/restore-from-s3.js(1 hunks)
🧠 Learnings (4)
📓 Common learnings
Learnt from: brayn003
PR: appsmithorg/appsmith#40462
File: app/client/src/instrumentation/index.ts:0-0
Timestamp: 2025-04-29T09:12:14.552Z
Learning: Only comment on files that are directly related to the PR's objectives, even if other files appear in the diff. For PR #40462, the focus is on the import override feature for artifacts, not on instrumentation or telemetry files.
Learnt from: sharat87
PR: appsmithorg/appsmith#37341
File: deploy/docker/base.dockerfile:49-50
Timestamp: 2024-11-12T14:29:18.087Z
Learning: In the Appsmith project, avoid pinning the minor Node.js version in Dockerfiles, aligning with the Node.js engine specified in `src/client/package.json` as `^20.11.1`.
Learnt from: sharat87
PR: appsmithorg/appsmith#37715
File: app/client/packages/rts/src/ctl/restore.ts:206-216
Timestamp: 2024-11-28T07:34:41.567Z
Learning: In `restore.ts`, within the `restoreDockerEnvFile` function, we intentionally make only minimal changes to the `docker.env` file and maintain a predictable order when adding environment variables.
Dockerfile (2)
Learnt from: sharat87
PR: #34317
File: deploy/docker/base.dockerfile:30-30
Timestamp: 2024-10-08T15:32:34.115Z
Learning: sharat87 prefers not to pin specific versions of software packages in the Dockerfile for the project, opting instead to automatically use the latest major versions.
Learnt from: sharat87
PR: #34317
File: deploy/docker/base.dockerfile:30-30
Timestamp: 2024-06-20T02:30:21.454Z
Learning: sharat87 prefers not to pin specific versions of software packages in the Dockerfile for the project, opting instead to automatically use the latest major versions.
deploy/docker/docker-compose.yml (10)
Learnt from: sharat87
PR: #37341
File: deploy/docker/base.dockerfile:49-50
Timestamp: 2024-11-12T14:29:18.087Z
Learning: In the Appsmith project, avoid pinning the minor Node.js version in Dockerfiles, aligning with the Node.js engine specified in src/client/package.json as ^20.11.1.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/utils/bin/index.js:18-18
Timestamp: 2024-06-12T11:16:26.661Z
Learning: The configuration file /appsmith-stacks/configuration/docker.env is ensured to exist at runtime within the Docker container, as clarified by sharat87.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/utils/bin/index.js:18-18
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The configuration file /appsmith-stacks/configuration/docker.env is ensured to exist at runtime within the Docker container, as clarified by sharat87.
Learnt from: abhvsn
PR: #36670
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:465-483
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In the deploy/docker/fs/opt/appsmith/entrypoint.sh script, APPSMITH_PG_DATABASE is a constant with the value appsmith, so we can assume it remains constant and doesn't require additional quoting in SQL commands.
Learnt from: abhvsn
PR: #36670
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:465-483
Timestamp: 2024-10-07T09:13:14.613Z
Learning: In the deploy/docker/fs/opt/appsmith/entrypoint.sh script, APPSMITH_PG_DATABASE is a constant with the value appsmith, so we can assume it remains constant and doesn't require additional quoting in SQL commands.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:94-95
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The directory /opt/appsmith/templates/supervisord/application_process/ exists in the Docker image at the specified location.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:94-95
Timestamp: 2024-06-12T11:13:15.926Z
Learning: The directory /opt/appsmith/templates/supervisord/application_process/ exists in the Docker image at the specified location.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:84-95
Timestamp: 2024-10-08T15:32:39.374Z
Learning: The environment files /appsmith-stacks/configuration/docker.env and $TMP/pre-define.env are generated at runtime, which is why they may not be found in static checks but will exist during actual execution.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:84-95
Timestamp: 2024-06-12T11:13:15.679Z
Learning: The environment files /appsmith-stacks/configuration/docker.env and $TMP/pre-define.env are generated at runtime, which is why they may not be found in static checks but will exist during actual execution.
Learnt from: abhvsn
PR: #37068
File: deploy/docker/fs/opt/appsmith/pg-utils.sh:125-132
Timestamp: 2024-10-25T08:31:07.651Z
Learning: In deploy/docker/fs/opt/appsmith/pg-utils.sh, the POSTGRES_ADMIN_USER (postgres) uses trust-based authentication in the local environment, so password handling changes for local setup may not be needed.
deploy/docker/fs/opt/bin/restore-from-s3.js (10)
Learnt from: sharat87
PR: #37715
File: app/client/packages/rts/src/ctl/restore.ts:206-216
Timestamp: 2024-11-28T07:34:41.567Z
Learning: In restore.ts, within the restoreDockerEnvFile function, we intentionally make only minimal changes to the docker.env file and maintain a predictable order when adding environment variables.
Learnt from: sharat87
PR: #37829
File: app/client/packages/rts/src/ctl/backup/links/MongoDumpLink.ts:18-25
Timestamp: 2024-11-29T09:36:52.112Z
Learning: In app/client/packages/rts/src/ctl/backup/links/MongoDumpLink.ts, the destFolder parameter in executeMongoDumpCMD already includes randomness, so there's no need to append a timestamp to the backup file name.
Learnt from: sharat87
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:0-0
Timestamp: 2024-11-30T00:37:12.269Z
Learning: In deploy/docker/fs/opt/appsmith/utils/bin/backup.js, exception handling is performed outside the executePostgresDumpCMD function, so adding try-catch blocks within executePostgresDumpCMD that rethrow the error is unnecessary.
Learnt from: abhvsn
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:169-171
Timestamp: 2024-11-13T09:39:34.416Z
Learning: In backup.js, when using pg_dump in the executePostgresDumpCMD function, the --dbname= option is not mandatory; the PostgreSQL URL can be passed directly.
Learnt from: sharat87
PR: #37326
File: app/client/packages/rts/src/ctl/restore.ts:167-185
Timestamp: 2024-11-30T00:35:04.894Z
Learning: In the restore scripts (app/client/packages/rts/src/ctl/restore.ts), avoid introducing environment variables for default PostgreSQL credentials; the code doesn't need additional configurability for this.
Learnt from: sharat87
PR: #37663
File: app/client/packages/rts/src/ctl/backup.ts:264-267
Timestamp: 2024-11-23T15:15:51.853Z
Learning: In app/client/packages/rts/src/ctl/backup.ts (TypeScript, NodeJS), it is acceptable to pass appsmithMongoURI directly to the mongodump command without masking the connection string, and exposing the connection string in command execution is acceptable in this context.
Learnt from: sharat87
PR: #37326
File: app/client/packages/rts/src/ctl/restore.ts:157-191
Timestamp: 2024-11-30T00:33:25.779Z
Learning: In restore.ts, exceptions are already caught outside the individual restore functions (restoreMongoDB, restorePostgres), so adding try-catch blocks inside these functions is unnecessary.
Learnt from: sharat87
PR: #37356
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:242-242
Timestamp: 2024-11-13T09:25:45.218Z
Learning: In backup.js, prefer to keep error messages simple without adding calculations for constant values if the hardcoded value suffices.
Learnt from: sharat87
PR: #37829
File: app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts:50-65
Timestamp: 2024-11-29T09:33:28.991Z
Learning: In app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts, changes to the removeSensitiveEnvData function should be approached cautiously, as it is sensitive and potentially flaky.
Learnt from: abhvsn
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/export_db.js:11-17
Timestamp: 2024-11-13T09:41:48.119Z
Learning: In the export_db.js script located at deploy/docker/fs/opt/appsmith/utils/bin/export_db.js, it's acceptable to use simple string-based detection (e.g., dbUrl.startsWith('mongodb')) for determining the database type because the database URL is restrictive, and misconfiguration will cause the server to fail to start up. Therefore, using a URL parsing library for database URL detection is unnecessary in this context.
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: brayn003
PR: appsmithorg/appsmith#40462
File: app/client/src/instrumentation/index.ts:0-0
Timestamp: 2025-04-29T09:12:14.552Z
Learning: Only comment on files that are directly related to the PR's objectives, even if other files appear in the diff. For PR #40462, the focus is on the import override feature for artifacts, not on instrumentation or telemetry files.
Learnt from: sharat87
PR: appsmithorg/appsmith#37341
File: deploy/docker/base.dockerfile:49-50
Timestamp: 2024-11-12T14:29:18.087Z
Learning: In the Appsmith project, avoid pinning the minor Node.js version in Dockerfiles, aligning with the Node.js engine specified in `src/client/package.json` as `^20.11.1`.
Learnt from: sharat87
PR: appsmithorg/appsmith#37715
File: app/client/packages/rts/src/ctl/restore.ts:206-216
Timestamp: 2024-11-28T07:34:41.567Z
Learning: In `restore.ts`, within the `restoreDockerEnvFile` function, we intentionally make only minimal changes to the `docker.env` file and maintain a predictable order when adding environment variables.
Dockerfile (2)
Learnt from: sharat87
PR: #34317
File: deploy/docker/base.dockerfile:30-30
Timestamp: 2024-10-08T15:32:34.115Z
Learning: sharat87 prefers not to pin specific versions of software packages in the Dockerfile for the project, opting instead to automatically use the latest major versions.
Learnt from: sharat87
PR: #34317
File: deploy/docker/base.dockerfile:30-30
Timestamp: 2024-06-20T02:30:21.454Z
Learning: sharat87 prefers not to pin specific versions of software packages in the Dockerfile for the project, opting instead to automatically use the latest major versions.
deploy/docker/docker-compose.yml (10)
Learnt from: sharat87
PR: #37341
File: deploy/docker/base.dockerfile:49-50
Timestamp: 2024-11-12T14:29:18.087Z
Learning: In the Appsmith project, avoid pinning the minor Node.js version in Dockerfiles, aligning with the Node.js engine specified in src/client/package.json as ^20.11.1.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/utils/bin/index.js:18-18
Timestamp: 2024-06-12T11:16:26.661Z
Learning: The configuration file /appsmith-stacks/configuration/docker.env is ensured to exist at runtime within the Docker container, as clarified by sharat87.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/utils/bin/index.js:18-18
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The configuration file /appsmith-stacks/configuration/docker.env is ensured to exist at runtime within the Docker container, as clarified by sharat87.
Learnt from: abhvsn
PR: #36670
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:465-483
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In the deploy/docker/fs/opt/appsmith/entrypoint.sh script, APPSMITH_PG_DATABASE is a constant with the value appsmith, so we can assume it remains constant and doesn't require additional quoting in SQL commands.
Learnt from: abhvsn
PR: #36670
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:465-483
Timestamp: 2024-10-07T09:13:14.613Z
Learning: In the deploy/docker/fs/opt/appsmith/entrypoint.sh script, APPSMITH_PG_DATABASE is a constant with the value appsmith, so we can assume it remains constant and doesn't require additional quoting in SQL commands.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:94-95
Timestamp: 2024-10-08T15:32:34.114Z
Learning: The directory /opt/appsmith/templates/supervisord/application_process/ exists in the Docker image at the specified location.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:94-95
Timestamp: 2024-06-12T11:13:15.926Z
Learning: The directory /opt/appsmith/templates/supervisord/application_process/ exists in the Docker image at the specified location.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:84-95
Timestamp: 2024-10-08T15:32:39.374Z
Learning: The environment files /appsmith-stacks/configuration/docker.env and $TMP/pre-define.env are generated at runtime, which is why they may not be found in static checks but will exist during actual execution.
Learnt from: sharat87
PR: #34206
File: deploy/docker/fs/opt/appsmith/entrypoint.sh:84-95
Timestamp: 2024-06-12T11:13:15.679Z
Learning: The environment files /appsmith-stacks/configuration/docker.env and $TMP/pre-define.env are generated at runtime, which is why they may not be found in static checks but will exist during actual execution.
Learnt from: abhvsn
PR: #37068
File: deploy/docker/fs/opt/appsmith/pg-utils.sh:125-132
Timestamp: 2024-10-25T08:31:07.651Z
Learning: In deploy/docker/fs/opt/appsmith/pg-utils.sh, the POSTGRES_ADMIN_USER (postgres) uses trust-based authentication in the local environment, so password handling changes for local setup may not be needed.
deploy/docker/fs/opt/bin/restore-from-s3.js (10)
Learnt from: sharat87
PR: #37715
File: app/client/packages/rts/src/ctl/restore.ts:206-216
Timestamp: 2024-11-28T07:34:41.567Z
Learning: In restore.ts, within the restoreDockerEnvFile function, we intentionally make only minimal changes to the docker.env file and maintain a predictable order when adding environment variables.
Learnt from: sharat87
PR: #37829
File: app/client/packages/rts/src/ctl/backup/links/MongoDumpLink.ts:18-25
Timestamp: 2024-11-29T09:36:52.112Z
Learning: In app/client/packages/rts/src/ctl/backup/links/MongoDumpLink.ts, the destFolder parameter in executeMongoDumpCMD already includes randomness, so there's no need to append a timestamp to the backup file name.
Learnt from: sharat87
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:0-0
Timestamp: 2024-11-30T00:37:12.269Z
Learning: In deploy/docker/fs/opt/appsmith/utils/bin/backup.js, exception handling is performed outside the executePostgresDumpCMD function, so adding try-catch blocks within executePostgresDumpCMD that rethrow the error is unnecessary.
Learnt from: abhvsn
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:169-171
Timestamp: 2024-11-13T09:39:34.416Z
Learning: In backup.js, when using pg_dump in the executePostgresDumpCMD function, the --dbname= option is not mandatory; the PostgreSQL URL can be passed directly.
Learnt from: sharat87
PR: #37326
File: app/client/packages/rts/src/ctl/restore.ts:167-185
Timestamp: 2024-11-30T00:35:04.894Z
Learning: In the restore scripts (app/client/packages/rts/src/ctl/restore.ts), avoid introducing environment variables for default PostgreSQL credentials; the code doesn't need additional configurability for this.
Learnt from: sharat87
PR: #37663
File: app/client/packages/rts/src/ctl/backup.ts:264-267
Timestamp: 2024-11-23T15:15:51.853Z
Learning: In app/client/packages/rts/src/ctl/backup.ts (TypeScript, NodeJS), it is acceptable to pass appsmithMongoURI directly to the mongodump command without masking the connection string, and exposing the connection string in command execution is acceptable in this context.
Learnt from: sharat87
PR: #37326
File: app/client/packages/rts/src/ctl/restore.ts:157-191
Timestamp: 2024-11-30T00:33:25.779Z
Learning: In restore.ts, exceptions are already caught outside the individual restore functions (restoreMongoDB, restorePostgres), so adding try-catch blocks inside these functions is unnecessary.
Learnt from: sharat87
PR: #37356
File: deploy/docker/fs/opt/appsmith/utils/bin/backup.js:242-242
Timestamp: 2024-11-13T09:25:45.218Z
Learning: In backup.js, prefer to keep error messages simple without adding calculations for constant values if the hardcoded value suffices.
Learnt from: sharat87
PR: #37829
File: app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts:50-65
Timestamp: 2024-11-29T09:33:28.991Z
Learning: In app/client/packages/rts/src/ctl/backup/links/EnvFileLink.ts, changes to the removeSensitiveEnvData function should be approached cautiously, as it is sensitive and potentially flaky.
Learnt from: abhvsn
PR: #37326
File: deploy/docker/fs/opt/appsmith/utils/bin/export_db.js:11-17
Timestamp: 2024-11-13T09:41:48.119Z
Learning: In the export_db.js script located at deploy/docker/fs/opt/appsmith/utils/bin/export_db.js, it's acceptable to use simple string-based detection (e.g., dbUrl.startsWith('mongodb')) for determining the database type because the database URL is restrictive, and misconfiguration will cause the server to fail to start up. Therefore, using a URL parsing library for database URL detection is unnecessary in this context.
🔇 Additional comments (3)
Dockerfile (1)
1-1: LGTM! Multi-architecture base image support implemented correctly.The default
eclipse-temurin:17-jdk-jammybase image provides excellent ARM64/AMD64 compatibility for Graviton deployments while maintaining backward compatibility.deploy/docker/fs/opt/bin/restore-from-s3.js (1)
8-37: Well-structured simulation script with good practices.Excellent input validation, cross-platform compatibility with
os.tmpdir(), and clear fake mode indicators. The error handling and exit codes are properly implemented.deploy/docker/docker-compose.yml (1)
1-1: Clear documentation update for Graviton compatibility.The comment accurately reflects the purpose of this compose configuration.
|
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
|
This PR has been closed because of inactivity. |
This PR introduces support for deploying Appsmith on ARM64-based AWS EC2 Graviton instances (e.g., t4g.small, c7g.medium).
✅ Changes:
eclipse-temurin)amd64andarm64❗Note:
Due to AWS account limitations, I was not able to test this on an actual Graviton EC2 instance. The image builds cleanly and all Docker changes are ARM64-compatible, but I request a maintainer (or another contributor) to kindly verify on a Graviton instance if possible.
Fixes: #37870
Image tag issue fixed using release (multi-arch). Semantic title updated.