Skip to content

Commit d8c217d

Browse files
sivakumar-kailasamtoddjordan
authored andcommitted
Remove couch usage & generate archives instead (#21)
* Drop couch usage & generate archives instead * Some fixes & upgrades * Rearranged folder heirarchy * Update docs * fix travis script * Output msgs to stop timeout in travis * Keep versioned doc ids for ember data * Incremental processing - Ability to pass project name and/or version to index - Reorganized the logic so that we process one version of a doc at a time, ensuring that we don't need lot of memory * Add engines section * Add more info in package.json * Update dependency * Sync to local before start * Skip previously indexed docs * Sync to s3 at the end if requested * Fix formatting & update travis token's with siva's * Use the AWS env variable conventions * Update existing docs * Fix indentation
1 parent 2a3e451 commit d8c217d

23 files changed

+862
-1555
lines changed

.travis.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
11
language: node_js
22
node_js: '6'
3-
4-
env:
5-
global:
6-
- COUCH_URL="https://emberjs.cloudant.com/ember-api-docs"
7-
# export COUCH_USERNAME=xxxxx
8-
- secure: e80GjZi18denINfipJnduwS0C/7fYf3lf9XMmlYRsSObhXbja/wYmqZfZsXUC5mDZFfutTY0sJDmnF3ibc8ZkvY1LSJ/22K48KSOGYQZ95RJBAK+nHa5m29ZOocx9UJwuo/n4UFTqS0+u5gvg5ArPAUftPA6BUaMszxGURDroTtQPjCzUUkclbul4Nb8OD2/S9Kb959VUsZnC9VezQzNMrym7Fw8b7c5UiriwBAc58wrrgdIBfQII38SuMSgz0OERScFBUVRs+6ETmuVgG/YMLYzISzg5rzCmrDqfHDEElCRfasKJ0ukc+g/tM/onBSMJSNX7r4NjNUvIyZjG8djbm4mrTfiSSxikXXa6/EDsgHrWbl+50wRb12c9iEkQDb+qNOxemvzsXJyKFPSeC0r9Ta1C3YSe2bOWNUAxH3a3GKoSEuIbNfgzX2K6GiiKHzgLYCK+acMQJrtz4Qs/D2u/EI5ST1FWKyIIu2qWJ84LPWJKLGByTjOjEDQ+arpQWYn6ACTDl4Tv1luzagQ7txbJxqPLcFG6yOBPXH1R1sXJEJwB2wkS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tDZs16qUozILvXn9Oj05GZ4Uu7wy4TmwF5+6Ye+Fherc2UXQ8CWdjKqYoKY6usVCK0E251vlwk3cjkaZhc+xpLLIPEuVLnGC8CzxMJqaxa6zOrSjLXpZGXnRH3Lw=
15-
163
cache:
174
directories:
185
- "$HOME/.yarn-cache"
196
- node_modules
207
- tmp
21-
228
script:
239
- yarn run test
24-
- 'if [ "$TRAVIS_PULL_REQUEST" = false ]; then yarn start; else echo "We dont publish docs via PRs"; fi'
25-
10+
- if [ "$TRAVIS_PULL_REQUEST" = false ]; then AWS_SHOULD_PUBLISH=yes yarn start; else echo "We dont publish docs via PRs"; fi
2611
branches:
2712
only:
2813
- master
14+
env:
15+
global:
16+
- secure: NqKxv7m1J21O2z1QfNIKce85KW70IeID8SshF/Ekzn4F0eg3PGQHHVLwgYmiOTznRu0kb+m2lbD5C3KuXJcdXHQXaG8ByAOYytMd6+n/1IJdM8Ao1nhWPlzN0xcU9TqPtlbKlJeUw9+G7zFsBK6nGAc866/CO4zJblqdOh8pztJlP4iI8QqzenK/YWJg2AacLjxQHNqjPQtK48ItgV1pdrXgVFGj7si8VmOz9uGytcqB+aQCWx+sP/08hkdJoGaxixjMhe1oAJpEccCGTuJ8EXdCZpssz0aZeyVUQBG+19eDUraYMBIXm6nZhX9OK1aHGTT5A6/pcDbLpmz8gs8DG3j9semKp0DwRWg2iIvunKEk5IKogCkbaebDw1U6l4V6lP9BZPZ+ab8NnJHEUL9vrkKPaZ1qPUvmXVoDErciUzmNWP26aTMRfFIe4a2Ax6sSyzbl06STEyVaBTonfpNgcbpDZiR6C7ngsKYFVyUdf0kSHdAlchF+CEX99pyGJPgmrjromcbzSA9x3Uye5puT/2KQXFfKXRmMIflTePqi7PlLQ9t/Z1roWocfORaIsgobv1RfKwsHv5dw+7j8OVsk6//dZu5GFbNcqqCMqoRz0mQ1yG3t9oa2zfpDLyIGvxAvi8Owdcc3TgQQJ5xcZ63ziqgB4KtE/5COiccoEjNWT4k=
17+
- secure: QCpb0SMkTCAGUIEiv2Bhv4QRz6GOtUmRBq2Kjvorr0PP1pFUND3j2qI5QvBlzgZo6G23KGUQ08E0l0BwInoqYGSHBIAX1PhiTwnqnNOy0n2RJUaKqsED6vfqUbcFtyE9HtvMT3xwz38L2aHIHAdYEkfI2fNX5/SAhTz0+Ovtbd7kKbZvX4V21FOmqdUnZyoA66m5YTs8dPv+/52iHA7oTF06HvejQKbsiu2wbZ8pP/cKVLOxcPkb2mI9Y03cNlHWsEwKgYTIFYuz3UXa/v24TSFmDOj2YcYKYml2Pk3e0VZnw36+N/1yx6trkpceeodLGGe9EM8kIqstcYdGnMfA7S6ADu8Fh8F88lBBItVqqE984b9LVlXE+ujr88DQVOMu8YkzFN/RGF6fonvgPNZ5M9Q/n59+ycCJOqOW+LFzEs+liH2Z9Hbgft+LlYaT3QiJXNXqqgd/j4fNMGdCalFk0s7pVmMtN6gJzrbGbeLd3R7gJ8HFey9oycWsZO5eXKKQ/thfXfk2bdfuusyluPyqqU2O6W4fbpB80hIC5T4VClrT08ikuLHtuj7vFJVmxn4cVIecxHX+DmR9NXvZgS8M/r5uxp57purLt/RGQGBk/uJFLflOgoFBy/K9QQD280MvF5VrgzifyUvNR4wcCzE1XEVQmKZFeuGGDbB74eW1V4c=

README.md

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,26 @@
22

33
This app is for turning ember API doc build output into [json api](http://jsonapi.org/) compliant data for use in various applications seeking to use the Ember API.
44

5-
The script pulls yuidoc build output from all Ember versions from Amazon S3, converts it to json api format and pushes it to CouchDB.
6-
You can setup a CouchDB instance either [locally](#setting-up-a-local-couchdb-instance) or [on cloundant](#setting-up-a-couchdb-on-cloudant) for testing out changes to this app.
7-
8-
9-
## Setting up a local CouchDB instance
10-
11-
1. Install the latest release of [CouchDB](http://couchdb.apache.org/).
12-
1. Once installed, visit the [CouchDB UI](http://localhost:5984/_utils). From the top navigation section, Click "_Create Database_" and type in "*ember-api-docs*".
13-
1. Create a CouchDB admin user. Got to the section in the left nav called "_Admin Party!_", and supply a username and password.
14-
1. Set up CORS for CouchDB
15-
An easy way to do this is to use the script at https://github.com/pouchdb/add-cors-to-couchdb
16-
17-
```shell
18-
npm install -g add-cors-to-couchdb
19-
add-cors-to-couchdb -u <your admin couchdb username> -p <your admin couchdb password>
20-
```
21-
22-
23-
## Setting up a CouchDB on cloudant
24-
25-
1. A [cloudant](https://cloudant.com/) account is neccessary before proceeding with the following steps.
26-
1. Create a new Database and give it the name "*ember-api-docs*".
27-
1. Goto the "_Permissions_" tab in the nav.
28-
1. Click on "_Generate API Key_", save the credentials showed on the UI as we'll be using this in the next section as the CouchDB credentials.
29-
1. Click on the _"_writer"_ checkbox for the API user so that it can push docs to cloudant.
30-
1. Navigate to your account settings & in the "_CORS_" tab ensure that its enabled for all domains.
31-
5+
The script pulls yuidoc build output from all Ember versions from Amazon S3, converts it to json api format and creates an archive.
326

337
## Running the app
348

359
1. Fork/Clone [ember-jsonapi-docs](https://github.com/ember-learn/ember-jsonapi-docs)
36-
1. Run `npm install` or `yarn`
37-
1. Set the following environment variables:
38-
39-
```shell
40-
export COUCH_URL=http://localhost:5984/ember-api-docs # or COUCH_URL=https://user-name.cloudant.com/ember-api-docs
41-
export COUCH_USERNAME=<your couchdb username>
42-
export COUCH_PASSWORD=<your couchdb password>
43-
```
10+
1. Run `yarn` or `npm install` (Needs node 6+)
4411
1. Set up AWS access
4512
```shell
46-
export AWS_ACCESS_KEY_ID=xxxxxx
47-
export AWS_SECRET_ACCESS_KEY=xxxxx
13+
export AWS_ACCESS_KEY=xxxxxx
14+
export AWS_SECRET_KEY=xxxxx
4815
```
4916
The app accesses builds.emberjs.com (an Amazon S3 bucket) in read-only mode, which is public. This requires any valid AWS credentials.
5017

5118
You can get your credentials by logging into your [AWS console](https://console.aws.amazon.com) and navigating to "_My Security Credentials_" under your profile name. You can generate a new pair under the "_Access Keys (Access Key ID and Secret Access Key)_" section.
5219
1. To test your changes in the app run,
53-
```node index.js 2.11```
54-
This will run the app only for the specified version of the docs. Once complete, if no errors you should see your doc database
55-
populated with data from your CouchDB admin ui. When no version is passed, the app will try to process all
56-
ember versions since 1.0 which takes high memory & time to complete. If you intend it, then run `node --max_old_space_size=8192 index.js`.
20+
```node index.js```
21+
Once complete, if no errors you should see a docs.tar file inside the `tmp` folder. The app tries to process all
22+
ember & ember-data versions since 1.0 which takes high memory & time to complete. If you intend it, then run `node --max_old_space_size=8192 index.js`.
5723
You are setting your node max heap space to 8GB, so make sure you have that much space available on your machine.
5824

5925

60-
## Setting up a new production instance
61-
62-
1. Follow the steps from [setting up a CouchDB on cloudant section](#setting-up-a-couchdb-on-cloudant)
63-
1. Run `npm start` or `yarn start` from your local. This is required since travis kills a build if [a task crosses 50mins](https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts), & the first run will take 50+ mins to complete.
64-
1. On Travis UI [enable cron jobs](https://docs.travis-ci.com/user/cron-jobs/) for daily/hourly basis so that newer docs get indexed incrementally.
26+
## To Generate docs for a specific project and/or version for development
27+
You can do this by passing `--project ember/ember-data --version 2.11.1` as an argument to the index script. e.g., `yarn start -- --project ember --version 2.11.0`

index.js

Lines changed: 57 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,67 @@
1-
'use strict'
1+
const RSVP = require('rsvp')
2+
const fs = require('graceful-fs')
3+
const argv = require('minimist')(process.argv.slice(2))
24

3-
let RSVP = require('rsvp')
4-
let _ = require('lodash')
5-
let rm = require('rimraf')
6-
let PouchDB = require('pouchdb')
7-
let fs = require('fs')
8-
let glob = require('glob')
5+
const markup = require('./lib/markup')
6+
const readDocs = require('./lib/read-docs')
7+
const fetchYuiDocs = require('./lib/fetch-yui-docs')
8+
const createClassesOnDisk = require('./lib/create-classes')
9+
const transformYuiObject = require('./lib/transform-yui-object')
10+
const normalizeEmberDependencies = require('./lib/normalize-ember-dependencies')
11+
const getVersionIndex = require('./lib/get-version-index')
12+
const saveDoc = require('./lib/save-document')
13+
const { syncToLocal, syncToS3 } = require('./lib/s3-sync')
914

10-
let fetch = require('./lib/fetch')
11-
let readDocs = require('./lib/read-docs')
12-
let addSinceTags = require('./lib/add-since-tags')
13-
let addInheritedItems = require('./lib/add-inherited-items')
14-
let transformModules = require('./lib/modules-transform')
15-
let putClassesInCouch = require('./lib/classes-in-couch')
16-
let createVersionIndex = require('./lib/create-version-index')
17-
let normalizeEmberDependencies = require('./lib/normalize-ember-dependencies')
18-
let normalizeIDs = require('./lib/normalize-ids')
19-
let markup = require('./lib/markup')
20-
let batchUpdate = require('./lib/batch-update')
21-
22-
require('marked')
23-
24-
let db = new PouchDB(process.env.COUCH_URL, {
25-
auth: {
26-
username: process.env.COUCH_USERNAME,
27-
password: process.env.COUCH_PASSWORD
28-
}
15+
RSVP.on('error', function (reason) {
16+
console.log(reason)
17+
process.exit(1)
2918
})
3019

31-
if (fs.existsSync('tmp/docs')) {
32-
rm.sync('tmp/docs')
33-
}
34-
35-
function transformProjectFiles (projectName) {
36-
console.log('reading docs for ' + projectName)
37-
let promise = RSVP.resolve(readDocs(projectName))
38-
.then((stuff) => {
39-
console.log('transforming modules for ' + projectName)
40-
return transformModules(stuff)
41-
}).then((stuff) => {
42-
console.log('adding since tags for ' + projectName)
43-
return addSinceTags(stuff)
44-
}).then((stuff) => {
45-
console.log('adding inherited items for ' + projectName)
46-
return addInheritedItems(stuff)
47-
}).then(yuidocs => {
48-
console.log('normalizing yuidocs for ' + projectName)
49-
return normalizeIDs(yuidocs, projectName)
50-
}).then(doc => {
51-
console.log('creating version index for ' + projectName)
52-
return createVersionIndex(db, projectName, doc).then(() => doc)
53-
}).then(doc => {
54-
console.log('converting markdown to html for ' + projectName)
55-
return markup(doc)
56-
})
20+
let possibleProjects = ['ember', 'ember-data']
21+
let projects = argv.project && possibleProjects.includes(argv.project) ? [argv.project] : possibleProjects
22+
let specificDocsVersion = argv.version ? argv.version : ''
5723

58-
return promise
59-
}
24+
let docsVersionMsg = specificDocsVersion !== '' ? '. For version ' + specificDocsVersion : ''
25+
console.log(`Downloading docs for ${projects.join(' & ')}${docsVersionMsg}`)
6026

61-
let projects = ['ember', 'ember-data']
62-
let releaseToGenDocFor = process.argv[2] ? process.argv[2] : ''
27+
syncToLocal()
28+
.then(() => fetchYuiDocs(projects, specificDocsVersion))
29+
.then(() => readDocs(projects, specificDocsVersion))
30+
.then(docs => {
31+
return RSVP.map(projects, projectName => {
32+
return RSVP.map(docs[projectName], doc => {
33+
let docVersion = doc.version
34+
console.log(`Starting to process ${projectName}-${docVersion}`)
35+
return transformYuiObject([doc], projectName).then(markup).then(doc => {
36+
let giantDocument = {
37+
data: doc.data
38+
}
39+
console.log('normalizing dependencies')
40+
return normalizeEmberDependencies(giantDocument)
41+
}).then(doc => {
42+
return createClassesOnDisk(doc, projectName, docVersion)
43+
}).then(doc => {
44+
console.log(`Finished processing ${projectName}-${docVersion}`)
45+
return getVersionIndex(doc, projectName)
46+
})
47+
}).then((docs) => {
48+
let [docToSave, ...remainingDocs] = docs.filter(doc => doc.data.id === projectName)
6349

64-
console.log('downloading docs for ' + projects.join(' & '))
50+
if (!docToSave) {
51+
return Promise.resolve()
52+
}
6553

66-
fetch(db, releaseToGenDocFor).then(downloadedFiles => {
67-
RSVP.map(projects, transformProjectFiles).then(docs => {
68-
let giantDocument = {
69-
data: _.flatten(docs.map(doc => doc.data))
70-
}
71-
console.log('normalizing dependencies')
72-
normalizeEmberDependencies(giantDocument)
54+
let existingDoc = `tmp/json-docs/${projectName}/projects/${projectName}.json`
55+
if (fs.existsSync(existingDoc)) {
56+
existingDoc = JSON.parse(fs.readFileSync(existingDoc))
57+
docToSave.data.relationships['project-versions'].data = docToSave.data.relationships['project-versions'].data.concat(existingDoc.data.relationships['project-versions'].data)
58+
}
7359

74-
return putClassesInCouch(giantDocument, db)
75-
}).then(function () {
76-
let docs = glob.sync('tmp/docs/**/*.json')
77-
78-
console.log('putting document in CouchDB')
79-
return batchUpdate(db, docs)
80-
}).catch(function (err) {
81-
console.warn('err!', err, err.stack)
82-
process.exit(1)
60+
remainingDocs.forEach(d => {
61+
docToSave.data.relationships['project-versions'].data = docToSave.data.relationships['project-versions'].data.concat(d.data.relationships['project-versions'].data)
62+
})
63+
return saveDoc(docToSave, projectName).then(() => projectName)
64+
})
65+
})
8366
})
84-
})
67+
.then(syncToS3)

lib/add-inherited-items.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = function addInheritedItems (docSets) {
1212

1313
classes.forEach(function (klass) {
1414
let parents = getParents(klass, classes)
15-
// let thisClassItems = classItems.filter(item => item.class === klass.name)
1615

1716
for (let i = 0; i < parents.length; ++i) {
1817
parents = parents.concat(getParents(parents[i], classes))

lib/batch-update.js

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
'use strict'
22

33
let RSVP = require('rsvp')
4-
let Queue = require('promise-queue')
54
let saveDoc = require('./save-document')
65

7-
module.exports = function (document, db) {
6+
module.exports = function (document, projectName, projectVersion) {
87
let things = document.data
9-
let queue = new Queue(10)
108

119
return RSVP.map(things, klass => {
1210
if (!klass.id) {
@@ -15,12 +13,10 @@ module.exports = function (document, db) {
1513
process.exit(1)
1614
}
1715
let document = {
18-
_id: klass.id,
1916
data: klass
2017
}
2118

22-
return queue.add(() => {
23-
return saveDoc(document, db)
24-
})
19+
console.log(`Creating ${klass.id} in ${projectName}-${projectVersion}`)
20+
return saveDoc(document, projectName, projectVersion)
2521
}).then(() => document)
2622
}

lib/create-project-versions.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
'use strict'
22

33
let tojsonapi = require('yuidoc-to-jsonapi/lib/converter')
4-
let Queue = require('promise-queue')
54
let RSVP = require('rsvp')
65
let saveDoc = require('./save-document')
76
let updateIDs = require('./update-with-versions-and-project')
87

98
module.exports = function createProjectVersions (versions, projectName, db) {
10-
let queue = new Queue(10)
11-
129
return RSVP.map(versions, version => {
1310
let jsonapidoc = updateIDs(tojsonapi(version.data), version.version)
1411

@@ -21,9 +18,7 @@ module.exports = function createProjectVersions (versions, projectName, db) {
2118
}
2219
}
2320

24-
let id = `project-version-${projectName}-${version.version}`
2521
let versionDocument = {
26-
_id: id,
2722
data: {
2823
id: `${projectName}-${version.version}`,
2924
type: 'project-version',
@@ -51,6 +46,6 @@ module.exports = function createProjectVersions (versions, projectName, db) {
5146
included: [projectData]
5247
}
5348

54-
return queue.add(() => saveDoc(versionDocument, projectName, version.version, db))
49+
return saveDoc(versionDocument, projectName, version.version)
5550
})
5651
}

0 commit comments

Comments
 (0)