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?

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 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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Node.js installation differs from the main Dockerfile because the NodeSource-based approach used there is not supported for the s390x architecture. As a result, using that method does not provide the required Node.js version on s390x. To ensure the simulator can still be built and function correctly on this architecture, nvm is used as a practical alternative.

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.76%. Comparing base (b8813c7) to head (89ba48b).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12337      +/-   ##
============================================
- Coverage     17.76%   17.76%   -0.01%     
  Complexity    15863    15863              
============================================
  Files          5923     5923              
  Lines        530558   530631      +73     
  Branches      64830    64840      +10     
============================================
+ Hits          94262    94274      +12     
- Misses       425749   425809      +60     
- Partials      10547    10548       +1     
Flag Coverage Δ
uitests 3.59% <ø> (+0.02%) ⬆️
unittests 18.85% <ø> (-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.

@viddya673
Copy link
Contributor Author

Hi @DaanHoogland,
The CloudStack simulator image itself was built on s390x and validated there. The UI screenshots shown were accessed using that same image, not from a separate x86 environment.

To clarify the screenshots:

  • Screenshot 1 shows the build environment running on an s390x system where the image was created.
  • Screenshot 3 shows the Management Server kernel information, which explicitly reports s390x, confirming the architecture.
  • In the last screenshot, the simulated agent reports its architecture as x86. This is due to the simulator’s default configuration, which does not impact functionality. Since it does not affect simulator behavior or the validation of s390x support, it was left unchanged. That said, I’m happy to adjust this if you feel it should be updated for clarity.

@DaanHoogland
Copy link
Contributor

  • Screenshot 3 shows the Management Server kernel information, which explicitly reports s390x, confirming the architecture.

Ah, I missed the bottom line in the third screenshot thanks.

  • In the last screenshot, the simulated agent reports its architecture as x86. This is due to the simulator’s default configuration, which does not impact functionality. Since it does not affect simulator behavior or the validation of s390x support, it was left unchanged. That said, I’m happy to adjust this if you feel it should be updated for clarity.

No I think we’re good, given enough reviews we can merge for my part.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Contributor

will you address the co-pilot's comments, btw @viddya673 ?

@viddya673
Copy link
Contributor Author

will you address the co-pilot's comments, btw @viddya673 ?

Yes, working on the comments and will respond shortly.

#
# CloudStack-simulator build

FROM ubuntu:22.04
Copy link
Contributor

@sureshanaparti sureshanaparti Dec 30, 2025

Choose a reason for hiding this comment

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

Suggested change
FROM ubuntu:22.04
FROM ubuntu:24.04

@viddya673 can use ubuntu 24.04 instead of 22.04?

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.

3 participants