-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 66d9184
Showing
19 changed files
with
10,798 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["@babel/preset-env"], | ||
"plugins": ["@babel/plugin-transform-runtime"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PORT=3000 | ||
DB_USER=postgres | ||
DB_PASSWORD=IrvingConde123 | ||
DB_SERVER=localhost | ||
DB_DATABASE=docentes | ||
DB_PORT=5432 | ||
|
||
JWT_SECRET=Centenito | ||
|
||
GMAIL_SERVICE=gmail | ||
GMAIL_USER=Irving.CondeM@Gmail.com | ||
GMAIL_DESTINY=Irving.Conde117@Gmail.om | ||
GMAIL_SUBJECT_ALTA_MATERIA=Se solicita un alta de materia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# Compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
/bazel-out | ||
|
||
# Node | ||
/node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# IDEs and editors | ||
.idea/ | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# Miscellaneous | ||
/.angular/cache | ||
.sass-cache/ | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
testem.log | ||
/typings | ||
|
||
# System files | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: master CI, CD workflow | ||
on: | ||
push: | ||
branches: [ "master"] | ||
pull_request: | ||
branches: [ "master"] | ||
jobs: | ||
master-ci-cd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.x | ||
- name: make .env | ||
uses: SpicyPizza/create-envfile@v1.3 | ||
with: | ||
envkey_DEV_DATABASE_URL : ${{ secrets.DEV_DATABASE_URL }} | ||
file_name: .env | ||
fail_on_empty: false | ||
|
||
- name: show dir, .env file | ||
run: | | ||
cat .env | ||
- name: Build the custom Docker image | ||
run: docker build -t ${{secrets.DOCKER_USER}}/${{secrets.MODEL_NAME}}:${{github.sha}} . | ||
|
||
- name: show docker images | ||
run: docker images | ||
|
||
- name: docker login | ||
env: | ||
DOCKER_USER: ${{secrets.DOCKER_USER}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
- name: Docker Push | ||
run: docker push ${{secrets.DOCKER_USER}}/${{secrets.MODEL_NAME}}:${{github.sha}} | ||
|
||
- name: update docker user in k8 | ||
run: sed -i 's/{docker_user}/${{secrets.DOCKER_USER}}/g' manifests/k8s.yml | ||
|
||
- name: update model name in k8 | ||
run: sed -i 's/{model_name}/${{secrets.MODEL_NAME}}/g' manifests/k8s.yml | ||
|
||
- name: update _ by - | ||
run: sed -i 's/_/-/g' manifests/k8s.yml | ||
|
||
- name: update sha in k8 | ||
run: sed -i 's/{github.sha}/${{github.sha}}/g' manifests/k8s.yml | ||
|
||
- name: ls -la | ||
run: cat manifests/k8s.yml | ||
|
||
- uses: okteto/context@2.7.0 | ||
with: | ||
token: ${{secrets.OKTETO_TOKEN }} | ||
|
||
- name: Deploy and Wait | ||
uses: okteto/actions/deploy@v1 | ||
env: | ||
KUBECONFIG: ${{ steps.namespace.outputs.kubeconfig }} | ||
with: | ||
namespace: ${{secrets.OKTETO_NAMESPACE }} | ||
manifest: manifests/k8s.yml | ||
tag: ${{ secrets.DOCKER_USERNAME }}/${{secrets.MODEL_NAME}}:${{github.sha}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM debian:bullseye | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y curl make g++ | ||
RUN curl -sL http://deb.nodesource.com/setup_16.x | bash - | ||
RUN apt-get install -y nodejs | ||
|
||
ADD . / | ||
|
||
RUN npm install | ||
EXPOSE 3000 | ||
|
||
CMD ["node", "./src/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#manifest | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {model_name}-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {model_name}-server | ||
replicas: 10 | ||
template: | ||
metadata: | ||
labels: | ||
app: {model_name}-server | ||
spec: | ||
containers: | ||
- name: {model_name}-container | ||
#image: gcr.io/tensorflow-serving/resnet | ||
image: docker.io/{docker_user}/{model_name}:{github.sha} | ||
ports: | ||
- containerPort: 3000 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
run: {model_name}-service | ||
name: {model_name}-service | ||
spec: | ||
ports: | ||
- port: 3000 | ||
targetPort: 3000 | ||
selector: | ||
app: {model_name}-server | ||
type: LoadBalancer |
Oops, something went wrong.