Skip to content

Commit c229737

Browse files
Merge pull request #47 from foglamp/1.7.0RC
1.7.0
2 parents f4fe6d9 + e3b9da9 commit c229737

File tree

24 files changed

+2588
-97
lines changed

24 files changed

+2588
-97
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@
99
*.idea
1010

1111
# Build
12-
packages/Debian/build/
12+
packages/Debian/build/
13+
14+
# Archived packages
15+
plugins/archive
16+
service/archive

README.rst

Lines changed: 130 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ Internal Structure
1717

1818
The repository contains the following set of files:
1919

20-
- Files named with **make_** prefix, such as ``make_deb``, are the shell scripts used to build the package. The scripts accept the architecture to build as argument (currently *x86* and *arm*).
21-
- The **packages** folder contains the list package types to build. At the moment, the only package type we provide is *Debian*.
20+
- Files named with **make_** prefix, such as ``make_deb``, ``make_rpm``, are the shell scripts used to build the package. The script runs as per the architecture to build.
21+
- The **packages** folder contains the list package types to build. It contains *Debian* and *rpmbuild*, latter for RedHat/Centos RPM creation.
2222

23-
- Inside the *packages/Debian* folder, we have the **architecture** folders, plus a *common* folder containing files that are common to all the architectures. The architectures that we provide at the moment are *armhf* and *x86_64*.
23+
- Inside the *packages/Debian* folder, we have the **architecture** folders, plus a *common* folder containing files that are common to all the architectures. The architectures that we provide at the moment are *aarch64*, *armv7l* and *x86_64*.
2424

25-
- Inside the architecture folder we have the DEBIAN folder, which contains all the Debian-based files, i.e. control, pre/post inst/rm, needed for the creation of the package.
25+
- Inside the architecture folder we have the DEBIAN folder, which contains only control file
26+
- Inside the common folder we have the DEBIAN folder, which contains pre/post inst/rm, needed for the creation of the package.
2627

27-
- After the first build, the *packages/Debian* will also contain a **build** folder. This folder contains a copy of what will be used to build the package (in a directory with the same name of the package) and the package itself.
28+
- After the first build, the *packages/Debian* will also contain a **build/architecture** folder. This folder contains a copy of what will be used to build the package (in a directory with the same name of the package) and the package itself.
2829

29-
- In the *build* folder, folders and files that have a sequence number are a previous package build.
30+
- In the *build/architecture* folder, folders and files that have a sequence number are a previous package build.
3031

3132

3233
The make_deb Script
3334
===================
3435

3536
.. code-block:: console
3637
37-
$ ./make_deb --help
38-
make_deb {x86|arm} [clean|cleanall]
38+
$ ./make_deb help
39+
make_deb [help|clean|cleanall]
3940
This script is used to create the Debian package of FogLAMP
4041
Arguments:
41-
x86 - Build an x86_64 package
42-
arm - Build an armv7l package
42+
help - Display this help text
4343
clean - Remove all the old versions saved in format .XXXX
4444
cleanall - Remove all the versions, including the last one
4545
$
@@ -55,71 +55,167 @@ The make_deb Script
5555
5656
5757
58-
Building a Package
59-
==================
58+
Building a Debian Package
59+
=========================
6060

6161
First, make sure that FogLAMP is properly installed via ``make install`` somewhere on your environment (default is */usr/local/foglamp*).
62-
Next, select the architecture to use, *x86* or *arm*.
63-
Finally, run the ``make_deb`` command:
62+
Finally, run the ``make_deb`` command and it will make as per ``arch``:
6463

6564
.. code-block:: console
6665
67-
$ ./make_deb x86
66+
$ ./make_deb
6867
The package root directory is : /home/foglamp/foglamp-pkg
6968
The FogLAMP directory is : /usr/local/foglamp
70-
The FogLAMP version is : 1.2
71-
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
69+
The FogLAMP version is : 1.6.0
70+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build/x86_64
7271
The architecture is set as : x86_64
73-
The package name is : foglamp-1.2-x86_64
72+
The package name is : foglamp-1.6.0-x86_64
7473
7574
Populating the package...Done.
7675
Building the new package...
77-
dpkg-deb: building package 'foglamp' in 'foglamp-1.2-x86_64.deb'.
76+
dpkg-deb: building package 'foglamp' in 'foglamp-1.6.0-x86_64.deb'.
7877
Building Complete.
7978
$
8079
8180
The result will be:
8281

8382
.. code-block:: console
8483
85-
$ ls -l packages/Debian/build/
84+
$ ls -l packages/Debian/build/x86_64
8685
total 564
87-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.2-x86_64
88-
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.2-x86_64.deb
86+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.6.0-x86_64
87+
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.6.0-x86_64.deb
8988
$
9089
9190
If you execute the ``make_deb`` command again, you will see:
9291

9392
.. code-block:: console
9493
95-
$ ./make_deb x86
94+
$ ./make_deb
9695
The package root directory is : /home/foglamp/foglamp-pkg
9796
The FogLAMP directory is : /usr/local/foglamp
98-
The FogLAMP version is : 1.2
99-
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build
97+
The FogLAMP version is : 1.6.0
98+
The package will be built in : /home/foglamp/foglamp-pkg/packages/Debian/build/x86_64
10099
The architecture is set as : x86_64
101-
The package name is : foglamp-1.2-x86_64
100+
The package name is : foglamp-1.6.0-x86_64
102101
103-
Saving the old working environment as foglamp-1.2-x86_64.0001
102+
Saving the old working environment as foglamp-1.6.0-x86_64.0001
104103
Populating the package...Done.
105-
Saving the old package as foglamp-1.2-x86_64.deb.0001
104+
Saving the old package as foglamp-1.6.0-x86_64.deb.0001
106105
Building the new package...
107-
dpkg-deb: building package 'foglamp' in 'foglamp-1.2-x86_64.deb'.
106+
dpkg-deb: building package 'foglamp' in 'foglamp-1.6.0-x86_64.deb'.
108107
Building Complete.
109108
$
110-
$ ls -l packages/Debian/build/
109+
$ ls -l packages/Debian/build/x86_64
111110
total 1128
112-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:53 foglamp-1.2-x86_64
113-
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.2-x86_64.0001
114-
-rw-r--r-- 1 foglamp foglamp 573080 Mar 23 17:54 foglamp-1.2-x86_64.deb
115-
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.2-x86_64.deb.0001
111+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:53 foglamp-1.6.0-x86_64
112+
drwxrwxr-x 4 foglamp foglamp 4096 Mar 23 17:35 foglamp-1.6.0-x86_64.0001
113+
-rw-r--r-- 1 foglamp foglamp 573080 Mar 23 17:54 foglamp-1.6.0-x86_64.deb
114+
-rw-r--r-- 1 foglamp foglamp 572742 Mar 23 17:35 foglamp-1.6.0-x86_64.deb.0001
116115
$
117116
118117
... where the previous build is now marked with the suffix *.0001*.
119118

120119

120+
The make_rpm Script
121+
===================
122+
.. code-block:: console
123+
124+
$ ./make_rpm --help
125+
make_rpm help [clean|cleanall]
126+
This script is used to create the RPM package of FogLAMP
127+
Arguments:
128+
help - Display this help text
129+
clean - Remove all the old versions saved in format .XXXX
130+
cleanall - Remove all the versions, including the last one
131+
$
132+
133+
Building a RPM Package
134+
======================
135+
136+
First, make sure that FogLAMP is properly installed via ``make install`` somewhere on your environment (default is */usr/local/foglamp*).
137+
Next, *x86* is the only currently supported architecture for RedHat/Centos.
138+
Finally, run the ``make_rpm`` command:
139+
140+
.. code-block:: console
141+
142+
$ ./make_rpm
143+
The package root directory is : /home/foglamp/repos/foglamp-pkg
144+
The FogLAMP directory is : /home/foglamp/foglamp
145+
The FogLAMP version is : 1.5.2
146+
The package will be built in : /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/RPMS/x86_64
147+
The package name is : foglamp-1.5.2-1.x86_64
148+
149+
Saving the old working environment as foglamp-1.5.2-1.x86_64.0077
150+
Populating the package and updating version in control file...Done.
151+
Prepare data directory
152+
Saving the old package as foglamp-1.5.2-1.x86_64.rpm.0001
153+
Building the new package...
154+
Processing files: foglamp-1.5.2-1.x86_64
155+
Provides: foglamp = 1.5.2-1 foglamp(x86-64) = 1.5.2-1
156+
Requires(interp): /bin/sh /bin/sh /bin/sh
157+
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
158+
Requires(pre): /bin/sh
159+
Requires(post): /bin/sh
160+
Requires(preun): /bin/sh
161+
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/BUILDROOT/foglamp-1.5.2-1.x86_64
162+
Wrote: /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/RPMS/x86_64/foglamp-1.5.2-1.x86_64.rpm
163+
Building Complete.
164+
$
165+
166+
The result will be:
167+
168+
.. code-block:: console
169+
170+
$ ls -l packages/rpmbuild/RPMS/x86_64
171+
total 6444
172+
-rw-rw-r-- 1 foglamp foglamp 6597376 May 10 02:08 foglamp-1.5.2-1.x86_64.rpm
173+
$
174+
175+
If you execute the ``make_rpm`` command again, you will see:
176+
177+
.. code-block:: console
178+
179+
$ ./make_rpm
180+
The package root directory is : /home/foglamp/repos/foglamp-pkg
181+
The FogLAMP directory is : /home/foglamp/foglamp
182+
The FogLAMP version is : 1.5.2
183+
The package will be built in : /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/RPMS/x86_64
184+
The package name is : foglamp-1.5.2-1.x86_64
185+
186+
Saving the old working environment as foglamp-1.5.2-1.x86_64.0079
187+
Populating the package and updating version in control file...Done.
188+
Prepare data directory
189+
Saving the old package as foglamp-1.5.2-1.x86_64.rpm.0001
190+
Building the new package...
191+
Processing files: foglamp-1.5.2-1.x86_64
192+
Provides: foglamp = 1.5.2-1 foglamp(x86-64) = 1.5.2-1
193+
Requires(interp): /bin/sh /bin/sh /bin/sh
194+
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
195+
Requires(pre): /bin/sh
196+
Requires(post): /bin/sh
197+
Requires(preun): /bin/sh
198+
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/BUILDROOT/foglamp-1.5.2-1.x86_64
199+
Wrote: /home/foglamp/repos/foglamp-pkg/packages/rpmbuild/RPMS/x86_64/foglamp-1.5.2-1.x86_64.rpm
200+
Building Complete.
201+
$ ls -l packages/rpmbuild/RPMS/x86_64
202+
total 12888
203+
-rw-rw-r-- 1 foglamp foglamp 6597420 May 10 02:10 foglamp-1.5.2-1.x86_64.rpm
204+
-rw-rw-r-- 1 foglamp foglamp 6597376 May 10 02:08 foglamp-1.5.2-1.x86_64.rpm.0001
205+
$
206+
207+
... where the previous build is now marked with the suffix *.0001*.
208+
209+
210+
121211
Cleaning the Package Folder
122212
===========================
123213

124214
Use the ``clean`` option to remove all the old packages and the files used to make the package.
125215
Use the ``cleanall`` option to remove all the packages and the files used to make the package.
216+
217+
218+
Packaging for Plugins
219+
======================
220+
221+
Please refer to documentation `here <plugins/README.rst>`_

docker/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ubuntu:18.04
2+
3+
MAINTAINER Vaibhav Singhal "[email protected]"
4+
5+
ARG FOGLAMP_BRANCH=master
6+
ENV FOGLAMP_BRANCH ${FOGLAMP_BRANCH}
7+
RUN apt-get update && apt-get -y upgrade
8+
RUN apt-get install -y git rsyslog
9+
10+
WORKDIR /foglamp-core
11+
12+
RUN git clone --single-branch -b $FOGLAMP_BRANCH https://github.com/foglamp/FogLAMP.git
13+
14+
RUN cd FogLAMP && \
15+
chmod +x requirements.sh && \
16+
./requirements.sh && \
17+
make install
18+
19+
RUN echo "service rsyslog start" > start.sh && \
20+
echo "/usr/local/foglamp/bin/foglamp start" >> start.sh && \
21+
echo "tail -f /dev/null" >> start.sh && \
22+
chmod +x start.sh
23+
24+
25+
ENV FOGLAMP_ROOT=/usr/local/foglamp
26+
27+
VOLUME /usr/local/foglamp/data
28+
29+
# These Volumes will be used in future when we want to install plugins
30+
VOLUME /usr/local/foglamp
31+
VOLUME /foglamp-core/FogLAMP
32+
33+
EXPOSE 8081 1995
34+
35+
CMD ["bash", "/foglamp-core/start.sh"]
36+

docker/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Installation
2+
3+
### Mac & Windows
4+
5+
Install Docker CE for Mac and Windows (http://docker.com)
6+
7+
### Ubuntu
8+
9+
To install Docker CE follow the instructions given here:
10+
11+
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
12+
13+
### Red Hat Enterprise Linux (RHEL)
14+
15+
```
16+
sudo yum install yum-utils
17+
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
18+
sudo yum install docker
19+
sudo systemctl daemon-reload
20+
sudo systemctl restart docker
21+
```
22+
### Build foglamp image
23+
24+
```
25+
docker build --tag foglamp --build-arg FOGLAMP_BRANCH=develop .
26+
```
27+
28+
where name of the image is foglamp, FOGLAMP_BRANCH is the branch to build (develop, master, 1.5.2 ,etc)
29+
30+
### Run container
31+
32+
33+
```
34+
$ docker run -d -v /foglamp-data:/usr/local/foglamp/data --name foglamp -p 8081:8081 -p 1995:1995 foglamp
35+
```
36+
37+
-d : run foglamp container in detached mode
38+
-v : maps host volume /foglamp-data to container volume /usr/local/foglamp/data
39+
--name : name of the container (foglamp)
40+
-p : map the port of host machine (8081) and container (:8081)
41+
foglamp : name of the image created in earlier step
42+
43+
> To attach to a running conatiner: `docker exec -it foglamp bash`
44+
45+
46+
### Stopping docker container
47+
```
48+
$ docker stop foglamp
49+
```
50+
51+
> Note: The files in foglamp-data directory are created by container which creates/runs them as root user. In order to read the foglamp.db, you need to change the permission of foglamp.db* files, sudo chmod 666 foglamp.db*

0 commit comments

Comments
 (0)