Skip to content

Conversation

@viddya673
Copy link
Contributor

Description

This PR adds s390x architecture support for the Apache CloudStack Simulator by introducing a dedicated Dockerfile for s390x.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Screenshot 2025-12-23 at 2 50 00 PM Screenshot 2025-12-23 at 2 53 59 PM Screenshot 2025-12-23 at 3 03 00 PM Screenshot 2025-12-23 at 3 05 49 PM

How Has This Been Tested?

How did you try to break this feature and the system with this change?

viddya673 and others added 2 commits December 22, 2025 21:29
Signed-off-by: Viddya K <viddya.k@ibm.com>
Signed-off-by: Niyam Siwach <niyam@ibm.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds s390x architecture support to the Apache CloudStack Simulator by introducing a dedicated Dockerfile for the s390x platform. The implementation is based on the existing Dockerfile but includes architecture-specific modifications.

Key changes:

  • New s390x-specific Dockerfile with architecture-appropriate gcc symlink configuration
  • Modified Node.js installation approach using nvm instead of nodesource repository
  • Additional Python cryptography dependencies for s390x compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +77 to +78
nvm install 10 && \
nvm use 10 && \
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The s390x Dockerfile installs Node.js version 10 using nvm, while the main Dockerfile (for x86_64) uses Node.js version 14 from nodesource. Node.js 10 reached end-of-life in April 2021 and is no longer supported or receiving security updates. Consider using Node.js 14 or later to match the main Dockerfile and ensure security and compatibility.

Suggested change
nvm install 10 && \
nvm use 10 && \
nvm install 14 && \
nvm use 14 && \

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +82
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
. /root/.nvm/nvm.sh && \
nvm install 10 && \
nvm use 10 && \
NVM_BIN="$(dirname "$(nvm which node)")" && \
ln -sf "$NVM_BIN/node" /usr/local/bin/node && \
ln -sf "$NVM_BIN/npm" /usr/local/bin/npm && \
cd ui && npm install && npm rebuild node-sass
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nvm installation approach differs from the main Dockerfile which uses the nodesource repository. While nvm provides flexibility, this creates maintenance inconsistency between architectures. If Node.js 14 from nodesource is not available for s390x, consider documenting this architectural difference with a comment explaining why nvm is required for s390x.

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +46
python3-mysql.connector \
python3-bcrypt \
python3-cryptography \
python3-cffi \
supervisor
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The s390x Dockerfile includes additional Python cryptography packages (python3-bcrypt, python3-cryptography, python3-cffi) that are not present in the main Dockerfile. If these packages are required for s390x-specific functionality or to address build issues on this architecture, consider adding a comment explaining why they are needed. Alternatively, if they should be in both Dockerfiles, the main Dockerfile may need updating as well.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +78
RUN apt-get install -y nodejs npm build-essential python3 g++ make && \
bash

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
. /root/.nvm/nvm.sh && \
nvm install 10 && \
nvm use 10 && \
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RUN command on line 72 installs build tools (nodejs, npm, build-essential, python3, g++, make) followed by a standalone bash command on line 73. The bash command appears incomplete and will cause the build to fail or hang. If these build tools are prerequisites for the subsequent nvm installation, they should be installed in a separate RUN layer before line 75, and line 73 should be removed.

Suggested change
RUN apt-get install -y nodejs npm build-essential python3 g++ make && \
bash
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
. /root/.nvm/nvm.sh && \
nvm install 10 && \
nvm use 10 && \
RUN apt-get install -y nodejs npm build-essential python3 g++ make
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
. /root/.nvm/nvm.sh && \
nvm install 10 && \
nvm use 10 && \
nvm use 10 && \

Copilot uses AI. Check for mistakes.
NVM_BIN="$(dirname "$(nvm which node)")" && \
ln -sf "$NVM_BIN/node" /usr/local/bin/node && \
ln -sf "$NVM_BIN/npm" /usr/local/bin/npm && \
cd ui && npm install && npm rebuild node-sass
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of npm operations differs from the main Dockerfile. This Dockerfile runs "npm install && npm rebuild node-sass" while the main Dockerfile runs "npm rebuild node-sass && npm install". The main Dockerfile's order is more correct as node-sass should be rebuilt after dependencies are already installed. Consider changing the order to match the main Dockerfile for consistency.

Suggested change
cd ui && npm install && npm rebuild node-sass
cd ui && npm rebuild node-sass && npm install

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +73
RUN apt-get install -y nodejs npm build-essential python3 g++ make && \
bash
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block installs Node.js dependencies before the nvm installation in lines 75-82. Consider combining these installations or reordering them to improve Docker layer caching and reduce image size. The nodejs and npm packages installed here may conflict with or be redundant with the nvm-installed versions.

Copilot uses AI. Check for mistakes.
RUN apt-get install -y nodejs npm build-essential python3 g++ make && \
bash

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash pattern downloads and executes remote shell code during the image build without any integrity or authenticity verification. If the nvm-sh repository or the delivery path is compromised, an attacker can serve a malicious script that will execute with full privileges inside the build, allowing them to backdoor the resulting simulator image. Prefer installing Node.js and related tooling from distribution packages or a vendored, checksummed artifact, or at minimum verify a cryptographic checksum or signature of the script before execution.

Copilot uses AI. Check for mistakes.
@DaanHoogland
Copy link
Contributor

@viddya673 , can you explain how this works?
The pics do not show me anything s390 specific. (are these supposed to be flicks istead of pics)?

tnx

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.50%. Comparing base (5bf869c) to head (8893ace).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12337      +/-   ##
============================================
- Coverage     17.51%   17.50%   -0.01%     
+ Complexity    15585    15582       -3     
============================================
  Files          5914     5914              
  Lines        529867   529867              
  Branches      64722    64722              
============================================
- Hits          92782    92772      -10     
- Misses       426635   426645      +10     
  Partials      10450    10450              
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.57% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants