Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update monitoring script and add propose code feature. #1254

Merged
merged 2 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/monitoring/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
nyc
nyc
*.tsbuildinfo
14 changes: 9 additions & 5 deletions server/monitoring/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

FROM node:10.16.0-slim
FROM node:12.13.1-slim

# Add Tini
ENV TINI_VERSION v0.18.0
Expand All @@ -17,12 +17,16 @@ COPY package-lock.json .
COPY package.json .
RUN npm install

# Copy over chaincode npmrc and package.json to dynamically install packages.
COPY chaincode/* /tmp/chaincode/

# Give write permission to node user.
RUN chown -R node:node /tmp/chaincode/
RUN chmod -R 755 /tmp/chaincode/*

# And now copy over our actual code and build
COPY . .
RUN npm run build

# Remove the npmrc following the build
RUN rm -f .npmrc
RUN npm run tsc

# Don't run as root user
USER node
Expand Down
7 changes: 3 additions & 4 deletions server/monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ Monitors Fluid production health via a cron job.

To build locally
```
docker build --build-arg NPM_TOKEN=$(echo $NPM_TOKEN) -t monitoring .
`npm run docker:build`
```

And to run locally
```
`docker run --rm -t monitoring`
`npm run docker:start`
```


Building and pushing to Fluid registry
```
docker build --build-arg NPM_TOKEN=$(echo $NPM_TOKEN) -t prague.azurecr.io/monitoring .
docker build -t prague.azurecr.io/monitoring .
docker push prague.azurecr.io/monitoring
```

Expand Down
1 change: 1 addition & 0 deletions server/monitoring/chaincode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
5 changes: 5 additions & 0 deletions server/monitoring/chaincode/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//localhost:4873/:_password="Ym9oZW1pYQ=="
//localhost:4873/:username=prague
//localhost:4873/:always-auth=true
//packages.wu2.prague.office-int.com/:_authToken="mQ12JIgL/OVL2fiPinbqIA=="
//packages.wu2.prague.office-int.com/:always-auth=true
2 changes: 2 additions & 0 deletions server/monitoring/chaincode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Base set of files used by the loader to dynamically install chaincode.

8 changes: 8 additions & 0 deletions server/monitoring/chaincode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "chaincode-loader",
"version": "0.0.1",
"description": "Headless chaincode loader",
"main": "index.js",
"author": "Microsoft",
"license": "MIT"
}
7 changes: 6 additions & 1 deletion server/monitoring/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"secret": "25d17e1a692f8d0ae6effae515d8ce2b",
"jwtKey": "VBQyoGpEYrTn3XQPtXW3K8fFDd",
"user": "fluid-monitor",
"waitMSec": 20000
"waitMSec": 20000,
"docId": "",
"proposal": {
"propose": false,
"package": "@fluid-example/key-value-cache@0.14.20262"
}
}
}
Loading