Skip to content

Commit 511c04f

Browse files
Merge pull request #31 from codeforequity-at/master
backward integration
2 parents bcbe830 + 54834e6 commit 511c04f

File tree

3 files changed

+51
-65
lines changed

3 files changed

+51
-65
lines changed

Makefile

Lines changed: 34 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,37 @@
11
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
22
VERSION := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
33

4-
docker_build_develop:
5-
docker build -t botium/botium-speech-frontend:develop frontend
6-
#docker build -t botium/botium-speech-watcher:develop watcher
7-
#docker build -f stt/Dockerfile.kaldi.en -t botium/botium-speech-kaldi-en:develop stt
8-
#docker build -f stt/Dockerfile.kaldi.de -t botium/botium-speech-kaldi-de:develop stt
9-
#docker build -f tts/Dockerfile.marytts -t botium/botium-speech-marytts:develop tts
10-
#docker build -t botium/botium-speech-dictate:develop dictate
11-
12-
docker_publish_develop:
13-
docker push botium/botium-speech-frontend:develop
14-
#docker push botium/botium-speech-watcher:develop
15-
#docker push botium/botium-speech-kaldi-en:develop
16-
#docker push botium/botium-speech-kaldi-de:develop
17-
#docker push botium/botium-speech-marytts:develop
18-
#docker push botium/botium-speech-dictate:develop
19-
20-
docker_build_release:
21-
docker build -t botium/botium-speech-frontend:$(VERSION) frontend
22-
docker build -t botium/botium-speech-watcher:$(VERSION) watcher
23-
docker build -f stt/Dockerfile.kaldi.en -t botium/botium-speech-kaldi-en:$(VERSION) stt
24-
docker build -f stt/Dockerfile.kaldi.de -t botium/botium-speech-kaldi-de:$(VERSION) stt
25-
docker build -f tts/Dockerfile.marytts -t botium/botium-speech-marytts:$(VERSION) tts
26-
docker build -t botium/botium-speech-dictate:$(VERSION) dictate
27-
28-
docker_publish_release:
29-
docker push botium/botium-speech-frontend:$(VERSION)
30-
docker push botium/botium-speech-watcher:$(VERSION)
31-
docker push botium/botium-speech-kaldi-en:$(VERSION)
32-
docker push botium/botium-speech-kaldi-de:$(VERSION)
33-
docker push botium/botium-speech-marytts:$(VERSION)
34-
docker push botium/botium-speech-dictate:$(VERSION)
35-
36-
docker_latest_release:
37-
docker tag botium/botium-speech-frontend:$(VERSION) botium/botium-speech-frontend:latest
38-
docker push botium/botium-speech-frontend:latest
39-
40-
docker tag botium/botium-speech-watcher:$(VERSION) botium/botium-speech-watcher:latest
41-
docker push botium/botium-speech-watcher:latest
42-
43-
docker tag botium/botium-speech-kaldi-en:$(VERSION) botium/botium-speech-kaldi-en:latest
44-
docker push botium/botium-speech-kaldi-en:latest
45-
46-
docker tag botium/botium-speech-kaldi-de:$(VERSION) botium/botium-speech-kaldi-de:latest
47-
docker push botium/botium-speech-kaldi-de:latest
48-
49-
docker tag botium/botium-speech-marytts:$(VERSION) botium/botium-speech-marytts:latest
50-
docker push botium/botium-speech-marytts:latest
51-
52-
docker tag botium/botium-speech-dictate:$(VERSION) botium/botium-speech-dictate:latest
53-
docker push botium/botium-speech-dictate:latest
54-
55-
develop: docker_build_develop docker_publish_develop
56-
57-
release: docker_build_release docker_publish_release docker_latest_release
4+
docker_build_dev:
5+
docker build -t botium/speech:develop frontend
6+
7+
docker_login_dev:
8+
AWS_ACCESS_KEY_ID=${BOTIUM_DEV_AWS_ACCESS_KEY_ID} \
9+
AWS_SECRET_ACCESS_KEY=${BOTIUM_DEV_AWS_SECRET_ACCESS_KEY} \
10+
aws ecr get-login-password --region ${BOTIUM_DEV_AWS_REGISTRY_REGION} | \
11+
docker login --username AWS --password-stdin ${BOTIUM_DEV_AWS_REGISTRY_ID}.dkr.ecr.${BOTIUM_DEV_AWS_REGISTRY_REGION}.amazonaws.com
12+
13+
docker_publish_dev: docker_login_dev
14+
docker tag botium/speech:develop ${BOTIUM_DEV_AWS_REGISTRY_HOSTNAME}/botium/speech:develop
15+
docker push ${BOTIUM_DEV_AWS_REGISTRY_HOSTNAME}/botium/speech:develop
16+
17+
docker_build:
18+
docker build -t botium/speech:$(VERSION) frontend
19+
20+
docker_login:
21+
AWS_ACCESS_KEY_ID=${BOTIUM_AWS_ACCESS_KEY_ID} \
22+
AWS_SECRET_ACCESS_KEY=${BOTIUM_AWS_SECRET_ACCESS_KEY} \
23+
aws ecr get-login-password --region ${BOTIUM_AWS_REGISTRY_REGION} | \
24+
docker login --username AWS --password-stdin ${BOTIUM_AWS_REGISTRY_ID}.dkr.ecr.${BOTIUM_AWS_REGISTRY_REGION}.amazonaws.com
25+
26+
docker_publish: docker_login
27+
docker tag botium/speech:$(VERSION) ${BOTIUM_AWS_REGISTRY_HOSTNAME}/botium/speech:$(VERSION)
28+
docker push ${BOTIUM_AWS_REGISTRY_HOSTNAME}/botium/speech:$(VERSION)
29+
30+
docker_latest: docker_login
31+
docker tag botium/speech:$(VERSION) ${BOTIUM_AWS_REGISTRY_HOSTNAME}/botium/speech:latest
32+
docker push ${BOTIUM_AWS_REGISTRY_HOSTNAME}/botium/speech:latest
33+
34+
35+
develop: docker_build_dev docker_publish_dev
36+
37+
release: docker_build docker_publish docker_latest

frontend/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ EXPOSE 56000
1414

1515
RUN groupadd --gid 1000 node && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
1616
RUN chown -R 1000:1000 /app
17+
RUN mkdir -p /app/resources && chown -R node:node /app/resources
18+
VOLUME /app/resources
19+
1720
USER node
18-
CMD npm run start-dist
21+
CMD npm run start-dist

frontend/src/routes.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ const ttsEngines = {
3939
google: new (require('./tts/google'))(),
4040
ibm: new (require('./tts/ibm'))(),
4141
azure: new (require('./tts/azure'))(),
42-
polly: new (require('./tts/polly'))(),
43-
marytts: new (require('./tts/marytts'))(),
44-
picotts: new (require('./tts/picotts'))()
42+
polly: new (require('./tts/polly'))()
43+
// marytts: new (require('./tts/marytts'))(),
44+
// picotts: new (require('./tts/picotts'))()
4545
}
4646
const sttEngines = {
4747
google: new (require('./stt/google'))(),
48-
kaldi: new (require('./stt/kaldi'))(),
48+
// kaldi: new (require('./stt/kaldi'))(),
4949
ibm: new (require('./stt/ibm'))(),
5050
azure: new (require('./stt/azure'))(),
5151
awstranscribe: new (require('./stt/awstranscribe'))()
@@ -144,7 +144,7 @@ const router = express.Router()
144144
* required: false
145145
* schema:
146146
* type: string
147-
* enum: [kaldi, google, ibm, azure, awstranscribe]
147+
* enum: [google, ibm, azure, awstranscribe]
148148
* responses:
149149
* 200:
150150
* description: List of supported STT languages
@@ -196,7 +196,7 @@ const router = express.Router()
196196
* required: false
197197
* schema:
198198
* type: string
199-
* enum: [kaldi, google, ibm, azure, awstranscribe]
199+
* enum: [google, ibm, azure, awstranscribe]
200200
* - name: cache
201201
* description: Use result cache (default Y)
202202
* in: query
@@ -299,7 +299,7 @@ router.post('/api/stt/:language', async (req, res, next) => {
299299
* required: false
300300
* schema:
301301
* type: string
302-
* enum: [google, ibm, azure, polly, marytts, picotts]
302+
* enum: [google, ibm, azure, polly]
303303
* responses:
304304
* 200:
305305
* description: List of supported voices
@@ -340,7 +340,7 @@ router.post('/api/stt/:language', async (req, res, next) => {
340340
* required: false
341341
* schema:
342342
* type: string
343-
* enum: [google, ibm, azure, polly, marytts, picotts]
343+
* enum: [google, ibm, azure, polly]
344344
* responses:
345345
* 200:
346346
* description: List of supported TTS languages
@@ -352,6 +352,9 @@ router.post('/api/stt/:language', async (req, res, next) => {
352352
;[router.get.bind(router), router.post.bind(router)].forEach(m => m('/api/ttslanguages', async (req, res, next) => {
353353
try {
354354
const tts = ttsEngines[(req.query.tts && sanitize(req.query.tts)) || process.env.BOTIUM_SPEECH_PROVIDER_TTS]
355+
if (_.isNil(tts)) {
356+
res.json([])
357+
}
355358
res.json(await tts.languages(req))
356359
} catch (err) {
357360
return next(err)
@@ -392,7 +395,7 @@ router.post('/api/stt/:language', async (req, res, next) => {
392395
* required: false
393396
* schema:
394397
* type: string
395-
* enum: [google, ibm, azure, polly, marytts, picotts]
398+
* enum: [google, ibm, azure, polly]
396399
* - name: cache
397400
* description: Use result cache (default Y)
398401
* in: query
@@ -780,7 +783,7 @@ const wssStreams = {}
780783
* required: false
781784
* schema:
782785
* type: string
783-
* enum: [kaldi, google, ibm, azure, awstranscribe]
786+
* enum: [google, ibm, azure, awstranscribe]
784787
* responses:
785788
* 200:
786789
* description: Websocket Url to stream the audio to, and the uri to check status and end the stream

0 commit comments

Comments
 (0)