Skip to content

Feature: Pool autoscale formula #300

Merged
johnnyzhang82 merged 20 commits intomasterfrom
feature/autoscale-formula
Apr 14, 2017
Merged

Feature: Pool autoscale formula #300
johnnyzhang82 merged 20 commits intomasterfrom
feature/autoscale-formula

Conversation

@johnnyzhang82
Copy link
Contributor

@johnnyzhang82 johnnyzhang82 commented Apr 10, 2017

Fix #107 Added scale mode picker in create pool form and integrated with codemirror text editor. Please review.
scalemode1
scalemode2
scalemode3

@msftclas
Copy link

@johnnyzhang82,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

.combineLatest(accountService.accountLoaded, settingsService.hasSettingsLoaded)
.subscribe((loadedArray) => {
this.isAppReady = loadedArray[0] && loadedArray[1];
this.autoscaleFormulaService.init();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a blank line here instead of indenting. The auto formatter will put it back

}

public changeScaleModeTab(event) {
if (event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this really be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, I am just afraid of null reference exception.

name: string;
value: string;
}
export class AutoscaleFormula extends AutoscaleFormulaRecord implements AutoscaleFormulaAttributes {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing blank line before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

enableInterNodeCommunication: output.enableInterNodeCommunication,
};

if (output.enableAutoScale) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hhm, I would do it the other way arround. Only add what's needed instead of removing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow convention below this code, anyway it's now updated.

@@ -0,0 +1,51 @@
(function(mod) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to do import * as CodeMirror from "codemirror" here instead

import "hammerjs";
import "./utils/extensions";

import "codemirror/addon/hint/show-hint.css";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see an update to package.json and yarn.lock did you added codemirror to the list of dep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installed yarn dependencies.

@johnnyzhang82 johnnyzhang82 force-pushed the feature/autoscale-formula branch from 33f851f to e90823e Compare April 11, 2017 18:11
import { Injectable } from "@angular/core";
import { AutoscaleFormula } from "app/models";
import { Constants, log } from "app/utils";
import * as storage from "electron-json-storage";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a service wrapping around electron-json-storage called LocalFileStorage. Use that instead it makes the testing easier and it is also cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also have to update ssh-key service as well. That's code I originally cloned from.

@johnnyzhang82 johnnyzhang82 force-pushed the feature/autoscale-formula branch from dd40a6d to 6dd163c Compare April 11, 2017 21:19
@@ -188,7 +185,7 @@ bl-autoscale-formula-picker {
display:block;
padding:0 2px;
transform:matrix(0.75, 0, 0, 0.75, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you needs this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is style of label in code editor section. Are there any class we can reuse in form? Because I only see placeholder attribute as a subtitle when blur, I cloned same style for autoscale editor.

"brace": "^0.10.0",
"bunyan": "^1.8.4",
"chart.js": "^2.5.0",
"codemirror": "^5.25.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the package twice? Should only be in the normal dependencies not dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed dev-dependencies cm.

];

// tslint:disable-next-line:max-line-length
const keywordRegex = /\$CPUPercent|\$WallClockSeconds|\$MemoryBytes|\$DiskBytes|\$DiskReadBytes\$DiskWriteBytes|\$DiskReadOps|\$DiskWriteOps|\$NetworkInBytes|\$NetworkOutBytes|\$SampleNodeCount|\$ActiveTasks|\$RunningTasks|\$PendingTasks|\$SucceededTasks|\$FailedTasks|\$CurrentDedicated|\$TargetDedicated/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how the codemirror modes works but could you here build the regex from an array here instead. It would look cleaner I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part I don't really like. I will refactor this regex to work better with a customize function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this part to a function that check whether given variables, function and system functions started with current word. If so, we display a list of word in auto complete ddl. Please review.

@johnnyzhang82 johnnyzhang82 requested a review from paselem April 11, 2017 23:39
@timotheeguerin timotheeguerin changed the title Feature/autoscale formula Feature: Pool autoscale formula Apr 13, 2017
}
}

bl-autoscale-formula-picker {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just merged a new way to handle styles. So you can use angular2 styleUrls check the tags.component.ts for a sample or the components.md doc. This will make styles cleaner

@johnnyzhang82 johnnyzhang82 merged commit 6c5c9bf into master Apr 14, 2017
@johnnyzhang82 johnnyzhang82 deleted the feature/autoscale-formula branch April 14, 2017 22:49
timotheeguerin added a commit that referenced this pull request Apr 19, 2017
* Adding tags to jobs and pools using metadata  (#286)

* Tags v1

* Save on enter

* Focus input on edit

* job tags

* Tags specs

* Fix tslint

* Fix undefined exception in tests

* General package update (#287)

* First set of update

* More update

* more

* Refresh account button (#290)

* add refresh button and method to account details

* Account refresh

* ff

* fix tslint

* OS picker improvement (#291)

* V1

* Working

* Clean

* update menu item style

* Cleanu

* Icons better

* Style nitpick

* Add icons license

* remove svg and use font-mfizz

* update

* Better icons

* fix tslint

* Cleanup icon selection

* fix svg to work with md-icons

* Forgot config folder

* Review PR

* Cleanup

* Created offer tile component

* Move data science

* Added bl-icon component

* Job pool picker improvement (#288)

* Job pool picker v1

* Job pool picker v1

* Added selected pool to the list

* Added tags

* Pool info return by the pool picker

* Added specs

* Fix tslint

* Fix specs

* Fix specs

* Use actual os icons

* Added sorting to bl-table (#293)

* Sortable table v1

* Moved display items logic to abstract list base

* Sorting all working

* Vm size table wired

* Fix specs

* Added table specs

* Fix max results bug with query cache (#296)

* Fix query list bug with max results

* Fix bug

* Fix bug with query cache loading items too litle at the time (#298)

* Fix bug with query cache loading items too litle at the time

* cleanup

* Rename maxResults to pageSize

* Fix pool details freeze after a minute (#301)

* Fix pool freeze

* cleanup

* fix tests

* Pricing for VM Sizes (#303)

* Pricing

* Save harware map locally

* Added local file storage service

* Added local file storage service

* Comment

* Disable pricing for now

* Change branch to master

* Added doc for storage

* Fix specs

* Fix specs

* Fix specs

* Clear the list keys when clearing the cache (#307)

* persisted task output files (#281)

* rename task output tab to be task log, added sub tabs to task outputs for persisted files

* storage service

* storage service updated

* basic ui and tabs working

* yarn add storage package

* comitting broken

* finish off wiring up node storage proxy factory, basic data through to UI, but not mapped to grid

* kinda working now and hooked up to the UI

* just fixing up CSS and some filter issues

* loads task outputs and logs, handles no container errors

* Handle linking to files from blob storage as well as the task and node API

* call listKeys, parse account name from storage url

* changes from review

* storage key cache, refresh button on account details page

* revert account changes, working on get blob properties

* rx entity proxy for storage

* sorted out my mistake, getting blob now

* file details display

* Fix no current account error

* for tim

* Fix shared

* remove console.log

* display file contents

* show selected file content from storage

* fix potential circular dependencies and bad merge

* fix contentLength as string issue

* review suggestions

* Update the batch client code to have custom header to every request and to use the promise (#306)

* Pool, Task and nodes

* New client proxy

* Fix

* Node proxy fixes

* Updated User-Agent

* Internal: Enabled component css with style urls and added docs (#312)

* Start make component styles

* Fix webpack

* Move remaining

* Fix css by disabling extract text plugin for now

* fix spec

* Feature: Pool autoscale formula  (#300)

* added autoscale formula picker

* Update some values to default

* 1, changed scalemode to tab.
2, added custom validator for target dedicated and autoscale formula in different mode.
3, register touch function for validating auto scale formula

* Fixed a build error for moment type

* added package config
converted autscale.js to ts
misc

* Fixed lint build erorrs

* set cm auto complete to prefix match instead of '$' trigger

* * Autoscale formula service updated to LocalFileStorage
* Review update and etc

* Completed autoscale validation style

* resolve conflict during merge

* refactor autoscale formula picker styles

* update style of codemirror placeholder

* Internal: Travis run prod build in branch builds and PRs against stable  (#314)

* prod build only stable test

* Typo

* Permissions

* if

* should not run prod now

* should run prod now

* should run NOT prod anymore

* renable all scripts

* Feature: New form experience with sections and picker (#308)

* Form Refactoring

* Wip

* Start task in other blade

* Form picker

* new forms

* Style

* change form layout (#305)

* change form layout

* rename 'name' to 'title' for stepper

* Picker smarter

* Picked works cleaner

* Cancel reset the form

* fix os picker and start task edit

* Update job create form

* Task new form

* app package form

* typo

* Form doc

* Missing images

* Missing images

* Job and app spec fix

* Picker specs

* Fix tslint

* style nitpick

* better picker style

* Integrate scale into

* Move form picker style separted

* Move page form separted

* Move page form separted

* fix

* Move form section

* fix tslint

* fix

* Show error at the bottom sticked to the footer (#319)

* Show error at the bottom sticked to the footer

* Added specs

* Added specs

* Pool scale picker (#320)

* Pool scale picker v1

* Fix

* fix editor submitting form on enter

* Editor cleanup

* more onpush

* Revert "more onpush"

This reverts commit 6877d69.

* Style imporvement

* update validity

* Perf: Small performance improvement (#322)

* Pool details pool os decorator

* Fix decorator

* Improve more

* fix

* Internal: Moved from styleUrls to regular import (#324)

* Moved from styleUrls to regular import

* Fix tslint

* fix prod

* Feature: Pool rescale supports autoscale (#325)

* Pool rescale support forumla

* Pool resize fixes

* Fixes

* Refactor: action-form and create-form into simple-form and complex-form (#327)

* Create form to complex form rename

* Fix specs after refactor

* Rename action form to simple form

* update job dialogs

* Updated application and task dialog

* node connect

* More refactor

* Fix tests

* Fix tslint

* Added changes for version 0.3.0 (#331)

* Added changes for version 0.3.0

* Added docs for new release

* Update version in package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants