Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fl/rust
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Oct 14, 2024
2 parents d893ed4 + 717de43 commit 88f7147
Show file tree
Hide file tree
Showing 285 changed files with 33,071 additions and 23,649 deletions.
4 changes: 0 additions & 4 deletions .docs/.eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions .docs/.eslintrc

This file was deleted.

36 changes: 17 additions & 19 deletions .docs/content/2.usage/use-armonik-api-in-an-angular-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ npm install -g @angular/cli
Then, you can create a new Angular App using the following command:

```bash
ng new --standalone --routing=false --inline-style --inline-template --skip-tests --style=css --skip-install armonik-api-angular
ng new --standalone --routing=false --inline-style --inline-template --skip-tests --skip-git --style=css --skip-install --package-manager=pnpm armonik-api-angular
```

Then, go to the newly created folder:
Expand Down Expand Up @@ -249,7 +249,8 @@ import { NgFor } from '@angular/common';
// ...
imports: [
NgFor
]
],
// ...
})
```

Expand Down Expand Up @@ -330,7 +331,8 @@ Now that you've created our service and our component, you are ready to use them
First, you need to inject the service in the component:

```typescript [app.component.ts]
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { PartitionsGrpcService } from './services/partitions-grpc.service';

@Component({
providers: [
Expand Down Expand Up @@ -377,7 +379,6 @@ export class AppComponent implements AfterViewInit {
}
}
);

}
}
```
Expand Down Expand Up @@ -440,11 +441,11 @@ If you look at the console, you will see another error:

```json
{
"statusCode": 3,
"statusMessage": "Property PageSize failed validation.\nProperty Filter failed validation.\nProperty Filter failed validation.\nProperty Sort.Field failed validation.\nProperty Sort.Field failed validation.",
"metadata": {
"map": {}
}
"statusCode": 3,
"statusMessage": "Property PageSize failed validation.\nProperty Filter failed validation.\nProperty Filter failed validation.\nProperty Sort.Field failed validation.\nProperty Sort.Field failed validation.",
"metadata": {
"map": {}
}
}
```

Expand All @@ -461,17 +462,14 @@ For simplicity, you will update the service directly. In a real world scenario,
+ page: 0,
+ pageSize: 10,
+ sort: {
+ direction: ListPartitionsRequest.OrderDirection.ORDER_DIRECTION_ASC,
+ field: ListPartitionsRequest.OrderByField.ORDER_BY_FIELD_ID
+ direction: SortDirection.SORT_DIRECTION_ASC,
+ field: {
+ partitionRawField: {
+ field: PartitionRawEnumField.PARTITION_RAW_ENUM_FIELD_ID
+ }
+ }
+ },
+ filter: {
+ id: '',
+ parentPartitionId: '',
+ podMax: 0,
+ podReserved: 0,
+ preemptionPercentage: 0,
+ priority: 0,
+ }
+ filters: {}
+ });

return this.#client.listPartitions(options);
Expand Down
71 changes: 71 additions & 0 deletions .docs/content/2.usage/use-armonik-grpc-securely-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Connecting to ArmoniK Securely using gRPC in Python

## Overview

This guide provides steps to connect to ArmoniK securely using gRPC in Python. ArmoniK supports both TLS and mTLS (mutual TLS) for secure communication.

## Prerequisites

Before proceeding, make sure that ArmoniK is deployed with the necessary certificates. Follow the steps below:

1. Ensure that ArmoniK is deployed with authentication. Refer to the [How to configure authentication in ArmoniK](https://aneoconsulting.github.io/ArmoniK/guide/how-to/how-to-configure-authentication#how-to-configure-authentication) guide for detailed instructions.

2. Deploy ArmoniK.

3. Certificates will be generated:

### TLS

- `ca.crt`: Certificate Authority root certificate

### mTLS

- `ca.crt`: Certificate Authority root certificate
- `client.submitter.crt`: Client certificate for submission
- `client.submitter.key`: Private key corresponding to the client certificate

## Create Credentials for a Secure Channel

### Use the provided certificates to establish secure channel credentials

When interacting with ArmoniK using Python, use the Common name as the endpoint. Ensure that the certificate's Common Name (CN) matches the endpoint name.

### If the given certificate common name doesn't match the endpoint name (Armonik default certificates for example)

Update your system's hosts file to associate the ArmoniK control plane address with the domain name "armonik.local". Use the following command to edit the hosts file:

```bash
sudo nano /etc/hosts
```

Use `armonik.local` as endpoint and don't forget to specify the port

```bash
armonik.local:5001
```

## Launching the Python Script

Once you have configured ArmoniK and updated your hosts file, you can execute the example script from the root. Ensure that you have the Armonik Python dependencie installed.

```bash
pip install armonik
```

1. **For Insecure Channel**

```bash
python examples/python/secure_grpc_client.py
```

2. **For TLS Secure Channel**

```bash
python examples/python/secure_grpc_client.py --endpoint armonik.local:5001 --ssl [--ca <ca.crt path>]
```

3. **For Mutual TLS Secure Channel**

```bash
python examples/python/secure_grpc_client.py --endpoint armonik.local:5001 --ssl [--ca <ca.crt path>] --key <client.submitter.key path> --cert <client.submitter.crt>
```
19 changes: 19 additions & 0 deletions .docs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'

export default createConfigForNuxt({
features: {
typescript: true
}
}).prepend({
rules: {
'vue/max-attributes-per-line': 'off',
'vue/no-multiple-template-root': 'off',
'vue/no-restricted-syntax': 'error'
},
ignores: [
'dist',
'node_modules',
'.output',
'.nuxt'
]
})
2 changes: 2 additions & 0 deletions .docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import process from 'node:process'

const baseURL = process.env.NODE_ENV === 'production' ? '/ArmoniK.Api/' : '/'

export default defineNuxtConfig({
Expand Down
11 changes: 5 additions & 6 deletions .docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "armonik-api-docs",
"version": "0.1.0",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"prepare": "nuxi prepare",
"dev": "nuxi dev",
Expand All @@ -15,13 +14,13 @@
"lint:md:fix": "markdownlint . --fix && case-police --fix ./**/*.md"
},
"dependencies": {
"@aneoconsultingfr/armonik-docs-theme": "^0.6.12",
"nuxt": "^3.6.1"
"@aneoconsultingfr/armonik-docs-theme": "^0.6.13",
"nuxt": "^3.6.5"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@nuxt/eslint-config": "^0.3.8",
"case-police": "^0.6.1",
"eslint": "^8.44.0",
"markdownlint-cli": "^0.35.0"
"eslint": "^9.0.0",
"markdownlint-cli": "^0.34.0"
}
}
Loading

0 comments on commit 88f7147

Please sign in to comment.