Skip to content
Open
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
47 changes: 24 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
![Screenshot](https://github.com/Symantec/cloudefficiency/raw/master/cloudefficiency.png)

# To run the report
1. install minikube
1. Install minikube
https://kubernetes.io/docs/tasks/tools/install-minikube/

2. To run:
#### Option 1
```
eval $(minikube docker-env)
docker build -t cloudefficiency .
Expand All @@ -18,9 +19,8 @@ export AWS_PROFILE=myprofile
envsubst < cronjob.yaml | kubectl create -f -
kubectl create job --from=cronjob/cloudefficiency-cronjob cloudefficiency-job
```

or

#### Option 2

```
docker build . -t cloudefficiency
docker run -it \
Expand All @@ -34,32 +34,32 @@ docker run -it \
```

# EC2 c-type instance cost/waste interactive reports by team and manager.
Three stages to produce EC2 c-type instance cost/waste interactive reports.
There are 3 stages to produce EC2 c-type instance cost/waste interactive reports.
ldap data + instance data -> user hierarchy and instance data -> static html/js isomorphic React pages.

## First two stages in python
## First 2 stages in python
`python3 -m report.allocate_efficiency`

### preparing raw data
1. gets ldap data for user hierarchy, and dl lists.
2. gets rightsizing recommendations for instances from cloudability.
### Preparing raw data
1. Gets ldap data for user hierarchy, and dl lists.
2. Gets rightsizing recommendations for instances from cloudability.

caches data to:
- ldap_entries.pickle
- dl_owners.pickle
- rightsizing_cache.json

### attributing ownership
3. assigns cost and waste to each individual
4. aggregate costs and wastes up reporting chain
### Attributing ownership
3. Assigns cost and waste to each individual
4. Aggregate costs and wastes up reporting chain

outputs:
#### Outputs:
- allInstances.js jsonp file
- allUsers.js jsonp file

`mv all*.js to frontend/src/`

# generating reports
# Generating reports
node ./dist/generate_files.js

cwd has `./output/*.html`
Expand All @@ -73,11 +73,12 @@ To run tests:
`npm test`

# Debugging

## Frontend
either insert `console.log` statements, or you can debug using jest:
Either insert `console.log` statements, or you can debug using jest:
`node --inspect-brk node_modules/.bin/jest --runInBand`
and open `chrome://inspect` in chrome
[more details](https://jestjs.io/docs/en/troubleshooting_
[more details] (https://jestjs.io/docs/en/troubleshooting_

# Configuration files
`logo.svg` in `frontend/public/logo.svg`
Expand Down Expand Up @@ -133,31 +134,31 @@ Analytics.updateEndpoint({
referrer: ...,
})

click CPE logo
Click CPE logo
{
name: 'click',
attributes: {
target: 'logo'
},
});

click issues
Click issues
{
name: 'click',
attributes: {
target: 'issues'
},
});

click help
Click help
{
name: 'click',
attributes: {
target: 'help'
},
});

click teammember
Click teammember
{
name: 'click',
attributes: {
Expand All @@ -166,7 +167,7 @@ click teammember
},
});

click manager
Click manager
{
name: 'click',
attributes: {
Expand All @@ -175,7 +176,7 @@ click manager
},
});

click owner
Click owner
{
name: 'click',
attributes: {
Expand All @@ -185,7 +186,7 @@ click owner
},
});

click ownerVp
Click ownerVp
{
name: 'click',
attributes: {
Expand Down