Skip to content

Commit

Permalink
BREAKING: Armadillo expect Rock images only.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemens-tolboom committed Dec 7, 2023
2 parents afd9fcc + cef74ac commit 26cc8f2
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 12 deletions.
35 changes: 30 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,49 @@
You can run from source code as follows:

1. Install Java and Docker
2. Checkout the source using ```git clone https://github.com/molgenis/molgenis-service-armadillo.git```
3. Optionally copy ```application.template.yml``` to ```application.yml``` to change settings (will be .gitignored)
4. Compile and execute the code using ```./gradlew run```
2. Checkout the source using `git clone https://github.com/molgenis/molgenis-service-armadillo.git`
3. Optionally copy `application.template.yml` to `application.yml` to change settings (will be .gitignored)
4. Compile and execute the code using `./gradlew run`

Note: contact MOLGENIS team if you want to contribute and need a testing OIDC config that you can run against localhost.

# Developing Armadillo

We use gradle to build:
* run using ```./gradlew run```
* run tests using ```./gradlew test```
* run using `./gradlew run`
* run tests using `./gradlew test`

We use intellij to develop
* To run or debug in intellij, right click on armadillo/src/main/java/org.molgenis.armdadillo/ArmadilloServiceAppliction and choose 'Run/Debug Armadillo...'
* To run using oidc, create a copy of [application.yml](application.template.yml) in root of your project

We have a swagger-ui to quickly see and test available web services at http://localhost:8080/swagger-ui/

## Components

We have several components

- [Armadillo](./armadillo/src/) source
- [UI](./ui/README.md) readme
- [R](./r/) java integration source
- [docker builds](./docker/) source
- [scripts](./scripts/README.md) migration readme
- [install](./scripts/install/README.md) readme
- [release](./scripts/release/) source
- [ops](./scripts/ops/README.md) readme

## Releasing

We release through [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) which autoincrement using [Semantic versioning](https://semver.org/).

Use `./gradlew nyxMake` to see what is build in [build/distributions](./build/distributions/).

List messages to see usage of conventional commits from the past.

```sh
git log --pretty=format:"%s" | cut -c -20
```

## Continuous integration

- we test on each PR and merges on master
Expand Down
15 changes: 14 additions & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Vue 3 + Vite
# Armadillo UI

## Test as a UI developer

From the terminal:
- `cd ui/`
- make sure you have `yarn` installed.
- `yarn test --watch`

Do your develop stuff and watch your test fail or succeed on the go. That is:
- change files in `src/**`
- change files in `tests/unit/**`

## How this project was generated

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

Expand Down
10 changes: 10 additions & 0 deletions ui/src/views/Profiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ export default defineComponent({
return profile.name;
});
const imageParts = profile.image.split(":");
if (imageParts.length == 1) {
this.errorMessage = `Save failed: [${profile.image}] needs a version added. Try [${profile.image}:latest]`;
return;
}
if (imageParts.length > 2) {
this.errorMessage = `Save failed: [${profile.image}] needs a version added. Try [${imageParts[0]}:latest]`;
return;
}
const hostPortCombo = `${profile.host}:${profile.port}`;
const hasDuplicates = this.profiles.some(
Expand Down
32 changes: 26 additions & 6 deletions ui/tests/unit/views/Profiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("Profiles", () => {

default_profile_not_running = {
name: "default",
image: "datashield/armadillo-rserver",
image: "datashield/rock-base:version",
host: "localhost",
port: 6311,
packageWhitelist: [
Expand All @@ -67,8 +67,7 @@ describe("Profiles", () => {
},
container: {
tags: [
"datashield/armadillo-rserver:2.0.0",
"datashield/armadillo-rserver:latest"
"datashield/rock-base:latest"
],
status: "NOT_RUNNING"
}
Expand All @@ -80,7 +79,7 @@ describe("Profiles", () => {
singleTestData = [
{
name: "profile-one",
image: "source/some_profile-one",
image: "source/some_profile-one:version-one",
host: "localhost",
port: 6312,
packageWhitelist: [
Expand All @@ -92,7 +91,7 @@ describe("Profiles", () => {
"datashield.seed": "100000001"
},
container: {
tags: ["source/some_profile-two"],
tags: ["source/some_profile-one:version-one"],
status: "NOT_RUNNING"
}
}
Expand All @@ -109,7 +108,7 @@ describe("Profiles", () => {

profileToAdd = {
name: "profile-two",
image: "other_source/profile-two",
image: "other_source/profile-two:version-two",
host: "localhost",
port: 6313,
packageWhitelist: [
Expand Down Expand Up @@ -217,6 +216,27 @@ describe("Profiles", () => {
expect(wrapper.vm.errorMessage).toBe("Save failed: cannot rename 'default' package.");
});

test("bad image name 'A' for profile", () => {
wrapper.vm.profiles.unshift(profileToAdd);
let p = {... profileToAdd};
p.image = 'A';
wrapper.vm.profiles.unshift(p);
wrapper.vm.profileToEditIndex = 0;
wrapper.vm.saveEditedProfile();
expect(wrapper.vm.errorMessage).toBe("Save failed: [A] needs a version added. Try [A:latest]");
});

test("bad image name 'A:B:C' for profile", () => {
wrapper.vm.profiles.unshift(profileToAdd);
let p = {... profileToAdd};
p.image = 'A:B:C';
wrapper.vm.profiles.unshift(p);
wrapper.vm.profileToEditIndex = 0;
wrapper.vm.saveEditedProfile();
expect(wrapper.vm.errorMessage).toBe("Save failed: [A:B:C] needs a version added. Try [A:latest]");

});

test("fail to use same port for profile", () => {
wrapper.vm.profiles.unshift(profileToAdd);
let p = {... profileToAdd};
Expand Down

0 comments on commit 26cc8f2

Please sign in to comment.