Skip to content

Commit

Permalink
Revert a few changes and completed the work
Browse files Browse the repository at this point in the history
Signed-off-by: Venu Vardhan Reddy Tekula <[email protected]>
  • Loading branch information
vchrombie committed Oct 19, 2022
1 parent 965408c commit 4d5c136
Show file tree
Hide file tree
Showing 23 changed files with 213 additions and 194 deletions.
36 changes: 18 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ or suggest something. Any feedback is appreciated!

If you are willing to setup the tutorial locally
```bash
$ git clone https://github.com/chaoss/grimoirelab-tutorial
$ cd grimoirelab-tutorial
$ bundle
$ bundle exec jekyll serve
git clone https://github.com/chaoss/grimoirelab-tutorial
cd grimoirelab-tutorial
bundle
bundle exec jekyll serve
```

**Note:** Make sure you have git and ruby (version 2.7.x) installed.
Expand All @@ -43,37 +43,37 @@ which is a fork (copy) of the GrimoireLab Tutorial.
2. Clone the forked git repository, and create in a local branch for your
contribution.

```
$ git clone https://github.com/username/grimoirelab-tutorial/
$ cd grimoirelab-tutorial/
$ git checkout -b new-branch-name
```bash
git clone https://github.com/username/grimoirelab-tutorial/
cd grimoirelab-tutorial/
git checkout -b new-branch-name
```

3. In this repository, set up a remote for the upstream (original grimoirelab-tutorial)
git repository.

```
$ git remote add upstream https://github.com/chaoss/grimoirelab-tutorial/
```bash
git remote add upstream https://github.com/chaoss/grimoirelab-tutorial/
```

4. Now you can change the documentation and then commit it. Except that the
contribution really needs it, use a single commit, and comment in detail in the
corresponding commit message what it is intended to do. If it fixes some bug,
reference it (with the text "_Fixes #23_", for example, for issue number 23).

```
$ git add -A
$ git commit -s
```bash
git add -A
git commit -s
```

5. Once your contribution is ready, rebase your local branch with `upstream/master`,
so that it merges clean with that branch, and push your local branch to a remote
branch to your GitHub repository.

```
$ git fetch upstream
$ git rebase upstream/master
$ git push origin new-branch-name
```bash
git fetch upstream
git rebase upstream/master
git push origin new-branch-name
```

6. In the GitHub interface, produce a pull request from your branch (you will
Expand All @@ -97,7 +97,7 @@ For ensuring it, a bot checks all incoming commits.
For users of the git command line interface, a sign-off is accomplished with the
`-s` as part of the commit command:

```
```bash
git commit -s -m 'This is a commit message'
```

Expand Down
10 changes: 5 additions & 5 deletions basics/dockerhub.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ To try `grimoirelab/full`, just type:

```bash
docker run -p 127.0.0.1:5601:5601 \
-v $(pwd)/credentials.cfg:/override.cfg \
-t grimoirelab/full
-v $(pwd)/credentials.cfg:/override.cfg \
-t grimoirelab/full
```

`credentials.cfg` should have a GitHub API token, in `mordred.cfg` format:

```
```cfg
[github]
api-token = XXX
```
Expand All @@ -35,8 +35,8 @@ If you're running the container on Windows through Docker Quickstart Terminal an

```bash
docker run -p x.x.x.x:5601:5601 \
-v $(pwd)/credentials.cfg:/override.cfg \
-t grimoirelab/full
-v $(pwd)/credentials.cfg:/override.cfg \
-t grimoirelab/full
```
but replace the x'ed out IP address with the IP address of your VM that you got from `ifconfig`. If all goes well, once you see the docker command line print out "Elasticsearch Aliased: Created!", you should be able to go to 127.0.0.1:5601 on your host machine web browser and be able to access the GrimoireLab dashboard.

Expand Down
6 changes: 3 additions & 3 deletions basics/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ as detailed in the
First, let's create our new environment. I like my Python virtual environments under the `venvs` subdirectory in my home directory, and in this case I will call it `gl` \(see how original I am!\):

```bash
python3 -m venv ~/venvs/gl
$ python3 -m venv ~/venvs/gl
```

Once the virtual environment is created, you can activate it:

```bash
source ~/venvs/gl/bin/activate
$ source ~/venvs/gl/bin/activate
(gl) $
```

Expand Down Expand Up @@ -215,7 +215,7 @@ sudo apt-get install build-essential

Usually, you know you need this when you have a problem installing `dulwich`. For example, you check the output of `pip install` and you find:

```
```bash
dulwich/_objects.c:21:10: fatal error: Python.h: No such file or Directory
```

Expand Down
4 changes: 2 additions & 2 deletions basics/quick.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Please check the [section on installing non-Python
packages](install.html#non-python-pkgs) if you have any trouble.

```bash
(gl) % pip3 install grimoirelab
(gl) $ pip3 install grimoirelab
```

If everything went well, you can just check the version that you installed:

```bash
(gl) % grimoirelab -v
(gl) $ grimoirelab -v
```

And that's it. You can now skip the rest of this chapter
Expand Down
4 changes: 2 additions & 2 deletions cases-chaoss/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ The process will include the installation of the GrimoireLab tools needed, and w
Let's start by installing GrimoireLab components:

```bash
python3 -m venv gl
source gl/bin/activate
$ python3 -m venv gl
$ source gl/bin/activate
(gl) $ pip install grimoire-elk grimoire-kidash
```

Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ while `upstream` points to the original CHAOSS repo.
An example is provided below.
```bash
git remote -v
# origin https://github.com/valeriocos/perceval (fetch)
# origin https://github.com/valeriocos/perceval (push)
# upstream https://github.com/chaoss/grimoirelab-perceval (fetch)
# upstream https://github.com/chaoss/grimoirelab-perceval (push)
origin https://github.com/valeriocos/perceval (fetch)
origin https://github.com/valeriocos/perceval (push)
upstream https://github.com/chaoss/grimoirelab-perceval (fetch)
upstream https://github.com/chaoss/grimoirelab-perceval (push)
```

In order to add a remote to a Git repository, you can use the following command:
Expand Down
24 changes: 14 additions & 10 deletions docs/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,30 @@ through the following means.

```bash
git --version
# git version 2.32.0

git version 2.32.0
```
```bash
docker --version
# Docker version 20.10.7, build f0df35096d

Docker version 20.10.7, build f0df35096d
```
```bash
docker-compose --version
# docker-compose version 1.28.5, build c4eb3a1f
docker-compose version 1.28.5, build c4eb3a1f
```

### Hardware

```bash
cat /proc/cpuinfo | grep processor | wc -l #View number of processors
# 4

4
```
```bash
grep MemTotal /proc/meminfo #View amount of RAM available
# MemTotal: 8029848 kB

MemTotal: 8029848 kB
```
```bash
sudo sysctl -w vm.max_map_count=262144 #Set virtual memory
# vm.max_map_count = 262144
vm.max_map_count = 262144
```

The reason for allocating `262144` for memory is the check that ElasticSearch
Expand Down
37 changes: 19 additions & 18 deletions docs/getting-started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ parent: Getting Started
It may also happen that the port, 5601, is already allocated to some other
container. So running docker-compose will lead to the following error

```console
```
WARNING: Host is already in use by another container
```

Expand All @@ -45,13 +45,14 @@ that container.

```bash
docker container ls # View all running containers
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# 01f0767adb47 grimoirelab/hatstall:latest "/bin/sh -c ${DEPLOY…" 2 minutes ago Up 2 minutes 0.0.0.0:8000->80/tcp, :::8000->80/tcp docker-compose_hatstall_1
# 9587614c7c4e bitergia/mordred:latest "/bin/sh -c ${DEPLOY…" 2 minutes ago Up 2 minutes (unhealthy) docker-compose_mordred_1
# c3f3f118bead bitergia/kibiter:community-v6.8.6-3 "/docker_entrypoint.…" 2 minutes ago Up 2 minutes 0.0.0.0:5601->5601/tcp, :::5601->5601/tcp docker-compose_kibiter_1
# d3c691acaf7b mariadb:10.0 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 3306/tcp docker-compose_mariadb_1
# f5f406146ee9 docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 "/usr/local/bin/dock…" 2 minutes ago Up 2 minutes 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 9300/tcp docker-compose_elasticsearch_1

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01f0767adb47 grimoirelab/hatstall:latest "/bin/sh -c ${DEPLOY…" 2 minutes ago Up 2 minutes 0.0.0.0:8000->80/tcp, :::8000->80/tcp docker-compose_hatstall_1
9587614c7c4e bitergia/mordred:latest "/bin/sh -c ${DEPLOY…" 2 minutes ago Up 2 minutes (unhealthy) docker-compose_mordred_1
c3f3f118bead bitergia/kibiter:community-v6.8.6-3 "/docker_entrypoint.…" 2 minutes ago Up 2 minutes 0.0.0.0:5601->5601/tcp, :::5601->5601/tcp docker-compose_kibiter_1
d3c691acaf7b mariadb:10.0 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 3306/tcp docker-compose_mariadb_1
f5f406146ee9 docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6 "/usr/local/bin/dock…" 2 minutes ago Up 2 minutes 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 9300/tcp docker-compose_elasticsearch_1
```
```bash
docker rm -f c3f3f118bead #c3f3f118bead is the container that is using port 5601.
```
Expand All @@ -76,7 +77,7 @@ localhost:9200` messages.
Diagnosis
Check for the following log in the output of `docker-compose up`
```console
```bash
elasticsearch_1 | ERROR: [1] bootstrap checks failed
elasticsearch_1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
```
Expand All @@ -103,13 +104,13 @@ Indication
Cannot open `localhost:9200` in browser, shows `Secure connection Failed`
```bash
curl -XGET localhost:9200 -k
# curl: (52) Empty reply from server
curl: (52) Empty reply from server
```
Diagnosis
Check for the following log in the output of `docker-compose up`
```console
```bash
elasticsearch_1 | [2020-03-12T13:05:34,959][WARN ][c.f.s.h.SearchGuardHttpServerTransport] [Xrb6LcS] Someone (/172.18.0.1:59838) speaks http plaintext instead of ssl, will close the channel
```
Expand Down Expand Up @@ -146,7 +147,7 @@ Can't create indices in Kibana. Nothing happens after clicking create index.
Diagnosis
Check for the following log in the output of `docker-compose up`
```console
```bash
elasticsearch_1 |[INFO ][c.f.s.c.PrivilegesEvaluator] No index-level perm match for User [name=readall, roles=[readall], requestedTenant=null] [IndexType [index=.kibana, type=doc]] [Action [[indices:data/write/index]]] [RolesChecked [sg_own_index, sg_readall]]
elasticsearch_1 | [c.f.s.c.PrivilegesEvaluator] No permissions for {sg_own_index=[IndexType [index=.kibana, type=doc]], sg_readall=[IndexType [index=.kibana, type=doc]]}
kibiter_1 | {"type":"response","@timestamp":CURRENT_TIME,"tags":[],"pid":1,"method":"post","statusCode":403,"req":{"url":"/api/saved_objects/index-pattern?overwrite=false","method":"post","headers":{"host":"localhost:5601","user-agent":YOUR_USER_AGENT,"accept":"application/json, text/plain, /","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/kibana","content-type":"application/json;charset=utf-8","kbn-version":"6.1.4-1","content-length":"59","connection":"keep-alive"},"remoteAddress":YOUR_IP,"userAgent":YOUR_IP,"referer":"http://localhost:5601/app/kibana"},"res":{"statusCode":403,"responseTime":25,"contentLength":9},"message":"POST /api/saved_objects/index-pattern?overwrite=false 403 25ms - 9.0B"}
Expand All @@ -167,11 +168,11 @@ Indication and Diagnosis
Check for the following error after executing [Micro
Mordred](https://github.com/chaoss/grimoirelab-sirmordred/tree/master/sirmordred/utils/micro.py)
using the below command (assuming `git` is the backend)
```console
```bash
micro.py --raw --enrich --panels --cfg ./setup.cfg --backends git
```
```console
```bash
[git] Problem executing study enrich_areas_of_code:git, RequestError(400, 'search_phase_execution_exception', 'No mapping found for [metadata__timestamp] in order to sort on')
```
Expand Down Expand Up @@ -218,13 +219,13 @@ Indication
Cannot open `localhost:9200` in browser, shows `Secure connection Failed`
```bash
curl -XGET localhost:9200 -k
# curl: (7) Failed to connect to localhost port 9200: Connection refused
curl: (7) Failed to connect to localhost port 9200: Connection refused
```
Diagnosis
Check for the following log in the output of `docker-compose up`
```console
```bash
elasticsearch_1 | ERROR: [1] bootstrap checks failed
elasticsearch_1 | [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
```
Expand Down Expand Up @@ -295,7 +296,7 @@ Indication
Diagnosis
```console
```bash
Retrying (Retry(total=10,connected=21,read=0,redirect=5,status=None)) after connection broken by
'SSLError(SSLError{1,'[SSL: WRONG_VERSION_NUMBER] wrong version number {_ssl.c:852}'},)': /
```
Expand All @@ -317,7 +318,7 @@ url = http://localhost:9200
Diagnosis
```console
```bash
: [Errno 2]No such file or directory : 'cloc': 'cloc'
```
Expand Down
8 changes: 4 additions & 4 deletions gelk/kidash.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ You can save a dashboard, with all its components, to a file, either for backup


```bash
(grimoireelk) kidash -e http://localhost:9200 --dashboard "Git" --export /tmp/dashboard-git.json
kidash -e http://localhost:9200 --dashboard "Git" --export /tmp/dashboard-git.json
```

You can learn the name of the dashboard by looking at its top left corner, or by noting the name you use when opening it in Kibana. If the name includes spaces, use "-" instead. For example, for a dashboard named "Git History", use the line:

```bash
(grimoireelk) kidash -e http://localhost:9200 --dashboard "Git-History" \
kidash -e http://localhost:9200 --dashboard "Git-History" \
--export /tmp/dashboard-git.json
```

Expand All @@ -42,7 +42,7 @@ We already restored a dashboard in the
We can restore from any file created with kidash. Assuming we have that file as `/tmp/dashboard-git.json`, we need to know the link to the ElasticSearch REST interface (same as for backing up). The format is, for example, as follows:

```bash
(grimoireelk) $ kidash --elastic_url http://localhost:9200 \
kidash --elastic_url http://localhost:9200 \
--import /tmp/dashboard-git.json
```

Expand All @@ -53,5 +53,5 @@ This will restore all elements in the file, overwriting, if needed, elements wit
Kidash has some more options. For a complete listing, use the `--help` argument:

```bash
(grimoireelk) $ kidash --help
kidash --help
```
4 changes: 2 additions & 2 deletions gelk/meetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Note: If your site redirects on page load, you may not see the code in the final
For each of the group names, you only need to run the following command, assuming the group name is `group_name` and the Meetup API key is `meetup_key`:

```bash
(gl) $ p2o.py --enrich --index meetup_raw --index-enrich meetup \
-e http://localhost:9200 --no_inc --debug meetup group_name -t meetup_key --tag group_name
p2o.py --enrich --index meetup_raw --index-enrich meetup \
-e http://localhost:9200 --no_inc --debug meetup group_name -t meetup_key --tag group_name
```

If the group has a sizable activity, the command will be retrieving data for a while, and uploading it to ElasticSearch, producing:
Expand Down
Loading

0 comments on commit 4d5c136

Please sign in to comment.