Skip to content

Commit 87b2341

Browse files
authored
Merge branch 'master' into revert-484-revert-482-fix/queue-parsing
2 parents f6bcf67 + 1f3a1dc commit 87b2341

4 files changed

Lines changed: 71 additions & 73 deletions

File tree

.circleci/config.yml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,37 @@
11
version: 2.1
22
orbs:
3-
datacamp-ecr: datacamp/ecr@0
4-
datacamp-deploy: datacamp/deploy@1
3+
datacamp-ecr: datacamp/ecr@1
4+
datacamp-deploy: datacamp/deploy@2
55
workflows:
66
version: 2
7-
build_test_deploy:
7+
build-and-deploy:
88
jobs:
99
- datacamp-ecr/build_and_push_image_to_ecr:
1010
name: build
1111
context: org-global
12-
aws-access-key-id: $STAGING_AWS_ACCESS_KEY_ID
13-
aws-secret-access-key: $STAGING_AWS_SECRET_ACCESS_KEY
14-
account-url: $STAGING_ECR_URL
15-
extra-docker-args: "--build-arg NPM_TOKEN=${NPM_TOKEN}"
16-
repo: rdoc-app
12+
aws-access-key-id: $OPS_AWS_ACCESS_KEY_ID
13+
aws-secret-access-key: $OPS_AWS_SECRET_ACCESS_KEY
14+
account-url: $OPS_ECR_URL
15+
puller-account-ids: '["301258414863", "487088987264"]'
1716
- datacamp-deploy/deploy: # Staging
1817
context: org-global
1918
requires:
2019
- build
21-
new-deploy-opt-in: true
22-
deploy-url: $STAGING_LAMBDA_DEPLOY_URL
23-
deploy-password: $STAGING_LAMBDA_DEPLOY_PASSWORD
20+
environment: staging
21+
aws-access-key-id: $STAGING_AWS_ACCESS_KEY_ID
22+
aws-secret-access-key: $STAGING_AWS_SECRET_ACCESS_KEY
2423
filters:
2524
branches:
2625
only:
2726
- master
28-
- datacamp-ecr/pull_push_to_account:
29-
context: org-global
30-
repo: rdoc-app
31-
filters:
32-
tags:
33-
only: /^release-.*/
34-
branches:
35-
ignore: /.*/
3627
- datacamp-deploy/deploy: # Production
3728
context: org-global
3829
requires:
39-
- datacamp-ecr/pull_push_to_account
40-
new-deploy-opt-in: true
41-
deploy-url: $PROD_LAMBDA_DEPLOY_URL
42-
deploy-password: $PROD_LAMBDA_DEPLOY_PASSWORD
30+
- build
31+
environment: prod
32+
aws-access-key-id: $PROD_AWS_ACCESS_KEY_ID
33+
aws-secret-access-key: $PROD_AWS_SECRET_ACCESS_KEY
4334
filters:
44-
tags:
45-
only: /^release-.*/
4635
branches:
47-
ignore: /.*/
36+
only:
37+
- master

CONTRIBUTING.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
1-
![rdocumentation_site_banner](https://cloud.githubusercontent.com/assets/1741726/17966806/d52c646a-6ac3-11e6-8f61-60379cfd70bb.png)
1+
# RDocumentation API
22

3-
rdocumentation.org provides the R community with centralized, quality and easy to search documentation.
4-
5-
R documentation sifts through all CRAN, GitHub and BioConductor packages hourly, parses the documentation files and indexes them in an Elasticsearch database. This makes rdocumentation.org the best online resource to browse all R package documentation.
6-
7-
The RDocs project is completely open-source. This repository contains the source code for the NodeJS web application that serves [www.rdocumentation.org](https://www.rdocumentation.org). For other codebases, you can check out [`CONTRIBUTING.md`](CONTRIBUTING.md).
8-
9-
## Features
10-
11-
- Quick search through all packages and functions
12-
13-
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
14-
15-
- Complete search through all packages and function
16-
17-
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
18-
19-
- Easily assess package quality
3+
_Important notes:_
204

21-
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
5+
1. Please read this [confluence page](https://datacamp.atlassian.net/wiki/spaces/PRODENG/pages/2314469377/RDocumentation) which explains the architecture of how RDocumentation works.
6+
2. This repo is now only used for its API. Please disregard all the UI code here. THe UI now lives in [datacamp/rdocumentation-2.0](https://github.com/datacamp/rdocumentation-2.0).
227

23-
- Post _community examples_ to help the community understand how to use a function
24-
25-
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
26-
27-
## What this app does
28-
29-
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
8+
rdocumentation.org provides the R community with centralized, quality and easy to search documentation.
309

31-
## Documentation
10+
R documentation sifts through all CRAN, GitHub and BioConductor packages hourly, parses the documentation files and indexes them in an Elasticsearch database. This makes rdocumentation.org the best online resource to browse all R package documentation.
3211

33-
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
12+
## How the API works
3413

35-
## Issue/Feature request
14+
You can check docs for the API by running the app locally and going to http://localhost:3000/docs/
3615

37-
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
16+
1. Newly parsed packages are added to the `rdocs-app-worker` SQS queue every hour.
17+
2. That queue is configured to hit the `/task` path which calls the `processMessage` method of the WorkerController
18+
3. That `processMessage` method adds topics to the mysql database
19+
4. After a query is sent to the API to request a topic, that topic is stored in Redis so that it's returned faster next time.
3820

3921
## Development
4022

@@ -43,13 +25,16 @@ Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues
4325
You'll need docker and docker-compose to run this stack locally
4426

4527
- Copy the .env.sample to .env and change relevant variables
28+
- If you already have a mysql db running on port 3306, update the `DATABASE_PORT` to another value as well as the port mapping in docker-compose.yml (e.g. change it to `"3308:3306"`)
4629
- `docker-compose create` to create the redis and mysql container
4730
- `docker-compose start` to fire up a local redis an mysql
4831
- Use the same node version in your terminal as the Dockerfile is using: `nvm use 8.16`
4932
- `npm install`
5033
- Run the database migrations by doing `npm run migrate`
5134
- `npm run start-dev`
5235

36+
Once the db is running, you can use a mysql client like dbeaver to access it. Connect to it based on the environment variables you have in `docker-compose.yml`. The server host should just be `localhost`.
37+
5338
### Troubleshooting
5439

5540
If you get an error: `SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client`
@@ -75,15 +60,6 @@ This application runs on the DataCamp infrastructure. Our custom CI flow will:
7560
- Upload it the ECR
7661
- Deploy the new version to ECS
7762

78-
## How to contribute
79-
80-
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
81-
82-
- Report when some packages are missing/outdated/incorrect by creating an issue.
83-
- Report bugs.
84-
- Help us improves by proposing features.
85-
- Directly contribute by forking the repo and making changes.
86-
8763
## License
8864

8965
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).

views/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
The information on this page comes from the original Readme when this app was used for its UI as well, but since the UI now lives in [datacamp/rdocumentation-2.0](https://github.com/datacamp/rdocumentation-2.0), this Readme is just there to remind you the good old' days of RDocumentation.
2+
3+
## Features
4+
5+
- Quick search through all packages and functions
6+
7+
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
8+
9+
- Complete search through all packages and function
10+
11+
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
12+
13+
- Easily assess package quality
14+
15+
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
16+
17+
- Post _community examples_ to help the community understand how to use a function
18+
19+
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
20+
21+
## What this app does
22+
23+
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
24+
25+
## Documentation
26+
27+
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
28+
29+
## Issue/Feature request
30+
31+
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
32+
33+
## How to contribute
34+
35+
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
36+
37+
- Report when some packages are missing/outdated/incorrect by creating an issue.
38+
- Report bugs.
39+
- Help us improves by proposing features.
40+
- Directly contribute by forking the repo and making changes.

0 commit comments

Comments
 (0)