Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 生产环境 arm机器排错 #869

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
file: docker/Dockerfile.${{ matrix.file }}
labels: ${{ steps.meta.outputs.labels }}
# only build arm64 in master commits
platforms: linux/amd64${{ github.ref_type == 'tag' && ',linux/arm64' || '' }}
platforms: linux/amd64${{ true && ',linux/arm64' || '' }}


release:
Expand Down
6 changes: 5 additions & 1 deletion apps/portal-server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export async function createServer() {
if (process.env.NODE_ENV === "production") {
await checkClustersRootUserLogin(server.logger);
await Promise.all(Object.entries(clusters).map(async ([id]) => {
await initShellFile(id, server.logger);
try {
await initShellFile(id, server.logger);
} catch (e) {
server.logger.error(e, `Failed to init shell file for cluster ${id}`);
}
}));
await setupProxyGateway(server.logger);
}
Expand Down
3 changes: 2 additions & 1 deletion apps/portal-server/src/utils/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export async function initShellFile(cluster: string, logger: Logger) {
// make sure directory /etc/profile.d exists.
await ssh.mkdir(PROFILE_DIRECTORY);
const sftp = await ssh.requestSFTP();

logger.info(cluster, "before ssh.putFile ======================");
await ssh.putFile(SHELL_FILE_LOCAL, SHELL_FILE_REMOTE);
logger.info(cluster, "ssh.putFile done ========================");
await sftpChmod(sftp)(SHELL_FILE_REMOTE, "755");
logger.info(`Copy scow-shell-file.sh to the ${SHELL_FILE_REMOTE} of the login node of cluster ${cluster}.`);
});
Expand Down
Loading