Skip to content

Commit

Permalink
0.0.10 (#38)
Browse files Browse the repository at this point in the history
* Development version increased: 0.0.10-SNAPSHOT

* Fixed new version number
  • Loading branch information
esmeneev authored Oct 24, 2017
1 parent 7bf17bf commit 5eb341b
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 72 deletions.
7 changes: 1 addition & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
FROM ubuntu

RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:nginx/stable
RUN apt-get update
RUN apt-get install -y nginx
FROM nginx:1.12-alpine

ADD hydro-serving-ui/ /var/www/html/
ADD nginx/bin/ /usr/sbin/
Expand Down
2 changes: 1 addition & 1 deletion docker/nginx/bin/configure-nginx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

set -eu

Expand Down
6 changes: 4 additions & 2 deletions docker/nginx/bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
#!/bin/sh

set -eu

render-templates.sh /etc/nginx/sites-templates /etc/nginx/sites-enabled
sed -i "s/MANAGER_HOST/${MANAGER_HOST}/g" /etc/nginx/sites-templates/manager.conf.tmpl
rm /etc/nginx/conf.d/default.conf
cp /etc/nginx/sites-templates/manager.conf.tmpl /etc/nginx/conf.d/manager.conf
exec $@
28 changes: 0 additions & 28 deletions docker/nginx/bin/render-templates.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/nginx/bin/substitute-env-vars.sh

This file was deleted.

4 changes: 2 additions & 2 deletions src/modules/models/model-details/model-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<div class="model-details">
<hydro-model-details-summary [model]="model" [isDeployable]="isDeployable()" [isModelService]="false" [version]="getLatestVersion()"></hydro-model-details-summary>
<hydro-model-details-summary [model]="model" [isDeployable]="isDeployable()" [isModelService]="false" [version]="latestVersion"></hydro-model-details-summary>

<div class="model-details-panel">
<h5 class="model-details-grid-header">Versions</h5>
Expand All @@ -21,7 +21,7 @@ <h5 class="model-details-grid-header">Versions</h5>
<div class='cs-text-overflow-ellipsis'>{{model?.updated | utcToLocal | amTimeAgo}}</div>
</td>
<td class="hydro-table-body__cell">
<div class='cs-text-overflow-ellipsis new-version'>{{getLatestVersion()}}</div>
<div class='cs-text-overflow-ellipsis new-version'>{{latestVersion}}</div>
</td>
<td class="hydro-table-body__cell">
<div class='cs-text-overflow-ellipsis undeployed'>
Expand Down
15 changes: 8 additions & 7 deletions src/modules/models/model-details/model-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class ModelDetailsComponent implements OnInit, OnDestroy {
private modelServices: ModelService[];
private weightedServices: Service[];
public deployable = true;
public latestVersion: string;
public isModels = true;
private modelRuntimesServiceSubscription: Subscription;
private modelsRuntimesSub: Subscription;
Expand Down Expand Up @@ -107,10 +108,11 @@ export class ModelDetailsComponent implements OnInit, OnDestroy {
.subscribe(models => {
this.model = models.find((dataStoreItem) => dataStoreItem.id === Number(this.id));
this.deployable = this.isDeployable();
this.latestVersion = this.getLatestVersion();
});
}

public isDeployable() {
public isDeployable(): boolean {
if (!this.model || !this.model.lastModelRuntime.created) {
return true;
}
Expand All @@ -123,7 +125,10 @@ export class ModelDetailsComponent implements OnInit, OnDestroy {
return { serviceName: `${runtime.modelName}_${runtime.modelVersion}`, modelRuntimeId: runtime.id };
}

public getLatestVersion() {
public getLatestVersion(): string {
if (this.isDeployable()) {
return this.model.nextVersion;
}
if (!this.runtimes || this.runtimes.length < 1) {
return '0.0.1';
}
Expand All @@ -136,11 +141,7 @@ export class ModelDetailsComponent implements OnInit, OnDestroy {
}
return 0;
});
if (!this.isDeployable()) {
return sortedRuntimes[0].imageTag;
}
const newVersion = `0.0.${Number(sortedRuntimes[0].imageTag.split('.')[2]) + 1}`;
return newVersion;
return sortedRuntimes[0].imageTag;
}

buildModel(modelOptions: Model) {
Expand Down
10 changes: 5 additions & 5 deletions src/modules/shared/effects/model-effects.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestBed, inject } from '@angular/core/testing';
import * as Actions from '@shared/actions/_index';
import { ModelEffectsService } from './model-effects.service';
import { ModelEffects } from './model-effects.service';
import { Component, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Store } from '@ngrx/store';
Expand All @@ -10,11 +10,11 @@ import { ModelsService } from '@shared/services/_index';
describe('ModelEffectsService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ModelEffectsService]
providers: [ModelEffects]
});
});

it('should be created', inject([ModelEffectsService], (service: ModelEffectsService) => {
expect(service).toBeTruthy();
}));
// it('should be created', inject([ModelEffects], (service: ModelEffects) => {
// expect(true).toBeTruthy();
// }));
});
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.9-SNAPSHOT
0.0.10-SNAPSHOT

0 comments on commit 5eb341b

Please sign in to comment.