Skip to content

Commit e85314f

Browse files
author
Chales Queiroz
committed
Merge branch 'main' into lbconfigs
# Conflicts: # engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql # ui/public/locales/en.json
2 parents ea7d322 + 3ec3007 commit e85314f

1,144 files changed

Lines changed: 28413 additions & 7853 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.asf.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ github:
2727
- infrastructure
2828
- java
2929
- python
30-
- hosting
3130
- kvm
31+
- libvirt
3232
- vsphere
33+
- vmware
3334
- xenserver
3435
- xcp-ng
36+
- orchestration
37+
- virtualization
38+
- virtual-machine
39+
- kubernetes
3540

3641
features:
3742
wiki: true
@@ -44,6 +49,11 @@ github:
4449
rebase: false
4550

4651
collaborators:
52+
- kiranchavala
53+
- rajujith
54+
- alexandremattioli
55+
- vishesh92
56+
- soreana
4757
- acs-robot
4858

4959
protected_branches: ~

.github/linters/.flake8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
# E242 Tab after ','
2121
# E273 Tab after keyword
2222
# E274 Tab before keyword
23+
# E742 Do not define classes named 'I', 'O', or 'l'
24+
# E743 Do not define functions named 'I', 'O', or 'l'
2325
# E901 SyntaxError or IndentationError
2426
# E902 IOError
2527
# W291 Trailing whitespace
@@ -28,4 +30,4 @@
2830
# W391 Blank line at end of file
2931

3032
[flake8]
31-
select = E223,E224,E242,E273,E274,E901,E902,W291,W292,W293,W391
33+
select = E223,E224,E242,E273,E274,E742,E743,E901,E902,W291,W292,W293,W391

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ jobs:
6363
run: |
6464
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss && cd nonoss && bash -x install-non-oss.sh && cd ..
6565
rm -fr nonoss
66-
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install
66+
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install -T$(nproc)

.github/workflows/ci.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ concurrency:
2525

2626
jobs:
2727
build:
28+
if: github.repository == 'apache/cloudstack'
2829
runs-on: ubuntu-22.04
2930

3031
strategy:
@@ -79,7 +80,8 @@ jobs:
7980
smoke/test_metrics_api
8081
smoke/test_migration
8182
smoke/test_multipleips_per_nic
82-
smoke/test_nested_virtualization",
83+
smoke/test_nested_virtualization
84+
smoke/test_set_sourcenat",
8385
"smoke/test_network
8486
smoke/test_network_acl
8587
smoke/test_network_ipv6
@@ -123,6 +125,7 @@ jobs:
123125
smoke/test_usage
124126
smoke/test_usage_events
125127
smoke/test_vm_deployment_planner
128+
smoke/test_vm_schedule
126129
smoke/test_vm_life_cycle
127130
smoke/test_vm_lifecycle_unmanage_import
128131
smoke/test_vm_snapshot_kvm
@@ -190,6 +193,8 @@ jobs:
190193

191194
steps:
192195
- uses: actions/checkout@v3
196+
with:
197+
fetch-depth: 0
193198

194199
- name: Set up JDK
195200
uses: actions/setup-java@v3
@@ -214,6 +219,11 @@ jobs:
214219
run: |
215220
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
216221
222+
- name: Install jacoco dependencies
223+
run: |
224+
wget https://github.com/jacoco/jacoco/releases/download/v0.8.10/jacoco-0.8.10.zip
225+
unzip jacoco-0.8.10.zip -d jacoco
226+
217227
- name: Env details
218228
run: |
219229
uname -a
@@ -237,7 +247,7 @@ jobs:
237247
238248
- name: Build with Maven
239249
run: |
240-
mvn -B -P developer,systemvm -Dsimulator clean install -DskipTests=true
250+
mvn -B -P developer,systemvm -Dsimulator clean install -DskipTests=true -T$(nproc)
241251
242252
- name: Setup Simulator Prerequisites
243253
run: |
@@ -246,9 +256,16 @@ jobs:
246256
mvn -q -Pdeveloper -pl developer -Ddeploydb
247257
mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
248258
259+
- name: Generate jacoco-coverage.sh
260+
run: |
261+
echo "java -jar jacoco/lib/jacococli.jar report jacoco-it.exec \\" > jacoco-report.sh
262+
find . | grep "target/classes" | sed 's/\/classes\//\/classes /g' | awk '{print "--classfiles", $1, "\\"}' | sort |uniq >> jacoco-report.sh
263+
find . | grep "src/main/java" | sed 's/\/java\//\/java /g' | awk '{print "--sourcefiles", $1, "\\"}' | sort | uniq >> jacoco-report.sh
264+
echo "--xml jacoco-coverage.xml" >> jacoco-report.sh
265+
249266
- name: Start CloudStack Management Server with Simulator
250267
run: |
251-
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom"
268+
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver"
252269
echo -e "\nStarting simulator"
253270
set +e
254271
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
@@ -272,10 +289,20 @@ jobs:
272289
done
273290
274291
echo -e "Stopping Simulator, integration tests run completed\n"
292+
java -jar jacoco/lib/jacococli.jar dump --address localhost --port 36320 --destfile jacoco-it.exec
293+
bash jacoco-report.sh
275294
mvn -Dsimulator -pl client jetty:stop 2>&1
276295
find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \;
277296
278297
- name: Integration Tests Result
279298
run: |
280299
echo -e "Simulator CI Test Results: (only failures listed)\n"
281300
python3 ./tools/marvin/xunit-reader.py integration-test-results/
301+
302+
- uses: codecov/codecov-action@v3
303+
with:
304+
files: jacoco-coverage.xml
305+
fail_ci_if_error: true
306+
flags: simulator-marvin-tests
307+
verbose: true
308+
name: codecov

.github/workflows/codecov.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
runs-on: ubuntu-22.04
3434
steps:
3535
- uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 0
3638

3739
- name: Set up JDK11
3840
uses: actions/setup-java@v3
@@ -45,11 +47,12 @@ jobs:
4547
run: |
4648
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
4749
cd nonoss && bash -x install-non-oss.sh && cd ..
48-
mvn -P quality -Dsimulator -Dnoredist clean install
50+
mvn -P quality -Dsimulator -Dnoredist clean install -T$(nproc)
4951
5052
- uses: codecov/codecov-action@v3
5153
with:
5254
files: ./client/target/site/jacoco-aggregate/jacoco.xml
5355
fail_ci_if_error: true
56+
flags: unit-tests
5457
verbose: true
5558
name: codecov

.github/workflows/linter.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,6 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
build:
31-
permissions:
32-
contents: read # for actions/checkout to fetch code
33-
statuses: write # for github/super-linter to mark status of each linter run
34-
name: Super-Linter Check
35-
runs-on: ubuntu-22.04
36-
steps:
37-
- name: Checkout Code
38-
uses: actions/checkout@v3
39-
with:
40-
# Full git history is needed to get a proper list of changed files within `super-linter`
41-
fetch-depth: 0
42-
- name: SuperLinter
43-
uses: github/super-linter/slim@v4.9.6
44-
env:
45-
DEFAULT_BRANCH: main
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
VALIDATE_ALL_CODEBASE: false
48-
VALIDATE_PYTHON_FLAKE8: true
4930
pre-commit:
5031
name: Run pre-commit
5132
runs-on: ubuntu-22.04

.github/workflows/main-sonar-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ permissions:
2828

2929
jobs:
3030
build:
31+
if: github.repository == 'apache/cloudstack'
3132
name: Main Sonar JaCoCo Build
3233
runs-on: ubuntu-22.04
3334
steps:
@@ -64,4 +65,4 @@ jobs:
6465
run: |
6566
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
6667
cd nonoss && bash -x install-non-oss.sh && cd ..
67-
mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack
68+
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack

.github/workflows/sonar-check.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@
1717

1818
name: Sonar Quality Check
1919

20-
on: [pull_request_target]
20+
on: [pull_request]
2121

2222
permissions:
23-
contents: read
23+
contents: read # to fetch code (actions/checkout)
24+
pull-requests: write # for sonar to comment on pull-request
2425

2526
concurrency:
2627
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2728
cancel-in-progress: true
2829

29-
permissions:
30-
contents: read # to fetch code (actions/checkout)
31-
pull-requests: write # for sonar to comment on pull-request
32-
3330
jobs:
3431
build:
3532
if: github.repository == 'apache/cloudstack'
@@ -73,4 +70,4 @@ jobs:
7370
run: |
7471
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
7572
cd nonoss && bash -x install-non-oss.sh && cd ..
76-
mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true
73+
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true

.github/workflows/ui.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ jobs:
4747
run: |
4848
cd ui
4949
sudo npm install -g @vue/cli npm-check-updates
50-
rm -f package-lock.json
5150
npm install
5251
npm run build
5352
npm run lint
5453
npm run test:unit
54+
55+
- uses: codecov/codecov-action@v3
56+
with:
57+
working-directory: ui
58+
files: ./coverage/lcov.info
59+
fail_ci_if_error: true
60+
flags: uitests
61+
verbose: true
62+
name: codecov

.pre-commit-config.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,39 @@ repos:
3434
#- id: check-merge-conflict
3535
- id: check-vcs-permalinks
3636
#- id: check-yaml
37-
#- id: detect-private-key
37+
- id: detect-private-key
38+
exclude: >
39+
(?x)
40+
^scripts/vm/systemvm/id_rsa\.cloud$|
41+
^server/src/test/java/com/cloud/keystore/KeystoreTest\.java$|
42+
^server/src/test/resources/certs/dsa_self_signed\.key$|
43+
^server/src/test/resources/certs/non_root\.key$|
44+
^server/src/test/resources/certs/root_chain\.key$|
45+
^server/src/test/resources/certs/rsa_ca_signed\.key$|
46+
^server/src/test/resources/certs/rsa_self_signed_with_pwd\.key$|
47+
^server/src/test/resources/certs/rsa_self_signed\.key$|
48+
^services/console-proxy/rdpconsole/src/test/doc/rdp-key\.pem$|
49+
^systemvm/agent/certs/localhost\.key$|
50+
^systemvm/agent/certs/realhostip\.key$
3851
- id: end-of-file-fixer
39-
files: \.(java|md|py|txt|yaml|yml)$
52+
exclude: \.vhd$
4053
#- id: fix-byte-order-marker
4154
- id: mixed-line-ending
4255
files: \.(java|md|py|txt|yaml|yml)$
4356
# - id: trailing-whitespace
57+
- repo: https://github.com/pycqa/flake8
58+
rev: 6.1.0
59+
hooks:
60+
- id: flake8
61+
args: [--config, .github/linters/.flake8]
62+
exclude: >
63+
(?x)
64+
^agent/bindir/cloud-setup-agent\.in$|
65+
^client/bindir/cloud-update-xenserver-licenses\.in$|
66+
^cloud-cli/bindir/cloud-tool$|
67+
^python/bindir/cloud-grab-dependent-library-versions$|
68+
^python/bindir/cloud-setup-baremetal$|
69+
^scripts/vm/hypervisor/xenserver/storagePlugin$|
70+
^scripts/vm/hypervisor/xenserver/vmopspremium$|
71+
^setup/bindir/cloud-setup-encryption\.in$|
72+
^venv/.*$

0 commit comments

Comments
 (0)