Skip to content

Commit 02e9228

Browse files
cleanup under developer guide (#404)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
1 parent 8a7f0c5 commit 02e9228

File tree

8 files changed

+71
-563
lines changed

8 files changed

+71
-563
lines changed

source/_static/images/plugin1.jpg

-32.2 KB
Binary file not shown.

source/_static/images/plugin2.jpg

-34.3 KB
Binary file not shown.

source/_static/images/plugin3.jpg

-41 KB
Binary file not shown.

source/_static/images/plugin4.png

-5.87 KB
Binary file not shown.
-1.46 KB
Binary file not shown.

source/developersguide/developer_guide.rst

Lines changed: 60 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,27 @@ CloudStack Installation from GIT repo for Developers
1818
====================================================
1919

2020
This guide is aimed at CloudStack developers who need to build the code.
21-
These instructions are valid on a Ubuntu 18.04 and CentOS 7 systems
22-
and were tested with the 4.11 release of Apache CloudStack. Please
23-
adapt them if you are on a different operating system or using a newer/older
24-
version of CloudStack. This book is composed of the following sections:
21+
These instructions are valid on a Ubuntu 22.04 and 24.04 systems
22+
and were tested with the 4.19 release of Apache CloudStack. Community maintained
23+
CloudStack self-learning course is also available at `CloudStack HackerBook
24+
<https://github.com/shapeblue/hackerbook/tree/main>`__.
25+
26+
Please adapt them if you are on a different operating system or using a
27+
newer/older version of CloudStack. This book is composed of the following
28+
sections:
2529

2630
#. Installation of the prerequisites
2731

2832
#. Compiling and installation from source
2933

30-
#. Using the CloudStack simulator
34+
#. Using the CloudStack Simulator
3135

32-
#. Installation with DevCloud the CloudStack sandbox
36+
#. Using Appliance for development
3337

3438
#. Building your own packages
3539

3640
#. The CloudStack API
3741

38-
#. Testing the AWS API interface
39-
40-
4142
Prerequisites
4243
-------------
4344

@@ -49,27 +50,22 @@ installed:
4950
* jdk 11+ (openjdk-11-jdk)
5051
* maven 3+
5152
* git
52-
* python-pip
53-
* python-setuptools
53+
* python3-pip
54+
* python3-setuptools
5455
* mkisofs
55-
* A MySql Server
56+
* MySql 8x Server
5657

57-
Example Ubuntu 18.04
58-
~~~~~~~~~~~~~~~~~~~~
58+
Example Ubuntu
59+
~~~~~~~~~~~~~~
5960

6061
::
6162

62-
apt update
63-
apt install openjdk-11-jdk-headless maven git python-pip mkisofs git mysql-server
63+
sudo apt update
64+
sudo apt install git openssh-client openjdk-11-jdk maven mysql-client mysql-server nfs-kernel-server quota genisoimage python3 python3-pip
6465

65-
Example CentOS 7
66-
~~~~~~~~~~~~~~~~
67-
68-
::
69-
70-
yum install -y epel-release
71-
yum localinstall -y http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
72-
yum install -y java-1.11.0-openjdk-devel maven python-setuptools python-pip genisoimage git mysql-community-server
66+
Note: ensure to install python 3.8/3.9/3.10, as required you can install
67+
specific Python3 versions using pyenv. Similarly, Java versions can be installed
68+
and managed using jenv.
7369

7470
Installing CloudStack from Source
7571
----------------------------------
@@ -86,7 +82,14 @@ To build a stable release, checkout the branch for that version:
8682

8783
::
8884

89-
git checkout 4.11.2
85+
git checkout 4.19
86+
87+
Optional, you can install noredist/nonoss dependencies:
88+
89+
::
90+
91+
git clone https://github.com/shapeblue/cloudstack-nonoss
92+
cd cloudstack-nonoss && bash -x install-non-oss.sh
9093

9194
To compile Apache CloudStack, go to the cloudstack source folder and
9295
run:
@@ -96,7 +99,8 @@ run:
9699
mvn -Pdeveloper,systemvm clean install
97100

98101
If you want to skip the tests add ``-DskipTests`` to the command above.
99-
Do NOT use ``-Dmaven.test.skip=true`` because that will break the build.
102+
Do NOT use ``-Dmaven.test.skip=true`` because that will break the build. To
103+
build noredist/nonoss add ``-Dnoredist`` flag to the command.
100104

101105
If you have set a root mysql password, you will need to adjust the password in
102106
``utils/conf/db.properties``
@@ -113,13 +117,24 @@ Run Apache CloudStack with jetty for testing
113117

114118
mvn -pl :cloud-client-ui jetty:run
115119

120+
To build and run the UI, do this:
121+
122+
::
123+
124+
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
125+
sudo apt install nodejs
126+
cd cloudstack/ui
127+
npm install
128+
npm run serve
129+
116130
Log Into Apache CloudStack:
117131

118132
Open your Web browser and use this URL to connect to CloudStack:
119133

120134
::
121135

122-
http://localhost:8080/client/
136+
http://localhost:5050 # this runs the UI
137+
http://localhost:8080/client/ # this is the API backend
123138

124139
Replace ``localhost`` with the IP of your management server if need be.
125140

@@ -168,122 +183,38 @@ Start jetty with the simulator enabled
168183

169184
::
170185

171-
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run
186+
mvn -Dsimulator -pl :cloud-client-ui jetty:run
172187

173188
Setup a basic or advanced zone with Marvin. In a separate shell://
174189

175190
::
176191

177-
python tools/marvin/marvin/deployDataCenter.py -i setup/dev/basic.cfg
192+
python3 tools/marvin/marvin/deployDataCenter.py -i setup/dev/basic.cfg
178193
OR
179-
python tools/marvin/marvin/deployDataCenter.py -i setup/dev/advanced.cfg
194+
python3 tools/marvin/marvin/deployDataCenter.py -i setup/dev/advanced.cfg
180195

181-
At this stage log in the CloudStack management server at
182-
http://localhost:8080/client with the credentials admin/password, you
183-
should see a fully configured zone infrastructure.
196+
At this stage log in the CloudStack management server UI at
197+
http://localhost:5050 or using CLI with the API endpoint at
198+
http://localhost:8080/client with the credentials admin/password, you should see
199+
a fully configured zone infrastructure.
184200

185201
You can now run integration tests, use the API etc.
186202

187-
Building non-free Packages
188-
--------------------------
189-
190-
Certain CloudStack packages are not built by default because they depend on
191-
libraries without redistribution rights. To build these, you need to install
192-
the dependencies manually.
193-
194-
::
195-
196-
git clone https://github.com/rhtyd/cloudstack-nonoss
197-
cd cloudstack-nonoss
198-
./install-non-oss.sh
199-
200-
You can then build and run CloudStack as normal by adding the `-Dnodist` flag
201-
to build and run lines, e.g.
202-
203-
::
204-
205-
mvn -Dsimulator -Dnoredist -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run
206-
207-
Using DevCloud
208-
--------------
203+
Using Appliance for development
204+
-------------------------------
209205

210206
The Installing from source section will only get you to the point of
211207
runnign the management server, it does not get you any hypervisors. The
212-
simulator section gets you a simulated datacenter for testing. With
213-
DevCloud you can run at least one hypervisor and add it to your
214-
management server the way you would a real physical machine.
215-
216-
`DevCloud <https://cwiki.apache.org/confluence/display/CLOUDSTACK/DevCloud>`__
217-
is the CloudStack sandbox, the standard version is a VirtualBox based
218-
image. There is also a KVM based image for it. Here we only show steps
219-
with the VirtualBox image. For KVM see the
220-
`wiki <https://cwiki.apache.org/confluence/display/CLOUDSTACK/devcloud-kvm>`__.
221-
222-
\*\* DevCloud Pre-requisites
223-
224-
#. Install `VirtualBox <http://www.virtualbox.org>`__ on your machine
225-
226-
#. Run VirtualBox and under >Preferences create a *host-only interface*
227-
on which you disable the DHCP server
208+
simulator section gets you a simulated datacenter for testing. An appliance
209+
based development such as using ``mbx`` can allow you to run at least one
210+
hypervisor and add it to your management server the way you would a real physical machine.
228211

229-
#. Download the DevCloud `image
230-
<http://people.apache.org/~bhaisaab/cloudstack/devcloud/devcloud2.ova>`__
231-
232-
#. In VirtualBox, under File > Import Appliance import the DevCloud
233-
image.
234-
235-
#. Verify the settings under > Settings and check the ``enable PAE``
236-
option in the processor menu
237-
238-
#. Once the Instance has booted try to ``ssh`` to it with credentials:
239-
``root/password``
240-
241-
ssh root@192.168.56.10
242-
243-
244-
Adding DevCloud as an Hypervisor
245-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246-
247-
Picking up from a clean build:
248-
249-
::
250-
251-
mvn -Pdeveloper,systemvm clean install
252-
mvn -P developer -pl developer,tools/devcloud -Ddeploydb
253-
254-
At this stage install marvin similarly than with the simulator:
255-
256-
::
257-
258-
pip install tools/marvin/dist/Marvin-|release|.tar.gz
259-
260-
Start the management server
261-
262-
::
263-
264-
mvn -pl client jetty:run
265-
266-
Then you are going to configure CloudStack to use the running DevCloud
267-
Instance:
268-
269-
::
270-
271-
cd tools/devcloud
272-
python ../marvin/marvin/deployDataCenter.py -i devcloud.cfg
273-
274-
If you are curious, check the ``devcloud.cfg`` file and see how the data
275-
center is defined: 1 Zone, 1 Pod, 1 Cluster, 1 Host, 1 primary Storage,
276-
1 Seondary Storage, all provided by Devcloud.
277-
278-
You can now log in the management server at
279-
``http://localhost:8080/client`` and start experimenting with the UI or
280-
the API.
281-
282-
Do note that the management server is running in your local machine and
283-
that DevCloud is used only as a n Hypervisor. You could potentially run
284-
the management server within DevCloud as well, or memory granted, run
285-
multiple DevClouds.
212+
MonkeyBox or `mbx <https://github.com/shapeblue/mbx>`__
213+
enable VM/appliance-based CloudStack development. It is tested with Ubuntu and
214+
uses KVM and prebuilt images to deploy QA and dev environments for anybody to
215+
try out CloudStack with a range of hypervisors, local and NFS storage.
286216

217+
Please refer to the project for more details: https://github.com/shapeblue/mbx
287218

288219
Building Packages
289220
-----------------
@@ -320,7 +251,6 @@ One directory up from the CloudStack root dir you will find:
320251
cloudstack_|release|.dsc
321252
cloudstack_|release|.tar.gz
322253
cloudstack-agent_|release|_all.deb
323-
cloudstack-awsapi_|release|_all.deb
324254
cloudstack-cli_|release|_all.deb
325255
cloudstack-common_|release|_all.deb
326256
cloudstack-docs_|release|_all.deb
@@ -487,53 +417,6 @@ is a sub-project of Apache CloudStack and gives operators/developers the
487417
ability to use any of the API methods. It has nice auto-completion and
488418
help feature as well as an API discovery mechanism since 4.2.
489419

490-
491-
Testing the AWS API interface
492-
-----------------------------
493-
494-
While the native CloudStack API is not a standard, CloudStack provides a
495-
AWS EC2 compatible interface. It has the great advantage that existing
496-
tools written with EC2 libraries can be re-used against a CloudStack
497-
based cloud. In the installation books we described how to run this
498-
interface from installing packages. In this section we show you how to
499-
compile the interface with ``maven`` and test it with Python boto
500-
module.
501-
502-
Starting from a running management server (with DevCloud for Instance),
503-
start the AWS API interface in a separate shell with:
504-
505-
::
506-
507-
mvn -Pawsapi -pl :cloud-awsapi jetty:run
508-
509-
Log into the CloudStack UI ``http://localhost:8080/client``, go to
510-
*Service Offerings* and edit one of the compute offerings to have the
511-
name ``m1.small`` or any of the other AWS EC2 Instance types.
512-
513-
With access and secret keys generated for a user you should now be able
514-
to use Python `Boto <http://docs.pythonboto.org/en/latest/>`__ module:
515-
516-
::
517-
518-
import boto
519-
import boto.ec2
520-
521-
accesskey="2IUSA5xylbsPSnBQFoWXKg3RvjHgsufcKhC1SeiCbeEc0obKwUlwJamB_gFmMJkFHYHTIafpUx0pHcfLvt-dzw"
522-
secretkey="oxV5Dhhk5ufNowey7OVHgWxCBVS4deTl9qL0EqMthfPBuy3ScHPo2fifDxw1aXeL5cyH10hnLOKjyKphcXGeDA"
523-
524-
region = boto.ec2.regioninfo.RegionInfo(name="ROOT", endpoint="localhost")
525-
conn = boto.connect_ec2(aws_access_key_id=accesskey, aws_secret_access_key=secretkey, is_secure=False, region=region, port=7080, path="/awsapi", api_version="2012-08-15")
526-
527-
images=conn.get_all_images()
528-
print images
529-
530-
res = images[0].run(instance_type='m1.small',security_groups=['default'])
531-
532-
Note the new ``api_version`` number in the connection object and also
533-
note that there was no user registration to make like in previous
534-
CloudStack releases.
535-
536-
537420
Conclusions
538421
-----------
539422

@@ -548,4 +431,4 @@ be. As a quick start, you might want to consider KVM+NFS and a Basic
548431
Zone.
549432

550433
If you've run into any problems with this, please ask on the
551-
cloudstack-dev `mailing list <http://cloudstack.apache.org/mailing-lists.html>`__.
434+
cloudstack-dev `mailing list <https://cloudstack.apache.org/mailing-lists.html>`__.

source/developersguide/get_help.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Need some help getting started? Feel free to ask on the `mailing list
2727
discussions about development and the project itself happen. This is a high
2828
volume list.
2929

30+
Github users can also start discussion at
31+
https://github.com/apache/cloudstack/discussions
32+
3033
Documentation Available
3134
-----------------------
3235

@@ -49,11 +52,15 @@ Books
4952
|60recipe| |acs-packt| |jp1| |jp2|
5053

5154

52-
Commercial support
53-
------------------
55+
Support
56+
-------
57+
58+
For community support you may ask on the project's users mailing list or via
59+
Github discussions.
5460

5561
Some companies offer commercial support for Apache CloudStack or their own
56-
product based on CloudStack.
62+
product based on CloudStack. You may ask on the list or `search yourself
63+
<https://www.google.com/search?q=cloudstack+support>`__.
5764

5865

5966
.. |60recipe| image:: /_static/images/60recipe.gif
@@ -67,4 +74,4 @@ product based on CloudStack.
6774
:target: http://www.amazon.co.jp/gp/product/4798130583/ref=as_li_ss_tl?ie=UTF8&camp=247&creative=7399&creativeASIN=4798130583&linkCode=as2&tag=aaaaaaaeaeaea-22
6875
.. |jp2| image:: /_static/images/jp2.jpg
6976
:alt: CloudStack実践ガイド[前編]
70-
:target: http://www.amazon.co.jp/CloudStack%E5%AE%9F%E8%B7%B5%E3%82%AC%E3%82%A4%E3%83%89-%E5%89%8D%E7%B7%A8-NextPublishing-%E5%A4%A7%E5%89%8A-%E7%B7%91/dp/4844395920/ref=pd_bxgy_b_img_y
77+
:target: http://www.amazon.co.jp/CloudStack%E5%AE%9F%E8%B7%B5%E3%82%AC%E3%82%A4%E3%83%89-%E5%89%8D%E7%B7%A8-NextPublishing-%E5%A4%A7%E5%89%8A-%E7%B7%91/dp/4844395920/ref=pd_bxgy_b_img_y

0 commit comments

Comments
 (0)