Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Oct 8, 2024
1 parent 443b9e1 commit 0d1a595
Showing 1 changed file with 13 additions and 58 deletions.
71 changes: 13 additions & 58 deletions slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ What is on the right is the certification Web API, loaded live. Use with caution
---
layout: top-title
color: gray-light
align: l-lm
align: lm
title: CLI
---

Expand All @@ -401,21 +401,21 @@ title: CLI

:: content ::

Logging in (using the `diracx cli`):
1. Logging in (using the `diracx cli`):

```sh
```bash {maxHeight:'80px'}
export DIRACX_URL=https://diracx-cert.app.cern.ch
❯ dirac login gridpp (diracx-dev)
❯ dirac login gridpp
Logging in with scopes: ['vo:gridpp']
Now go to: https://diracx-cert.app.cern.ch/api/auth/device?user_code=XYZXYZXYZ
.....Saved credentials to /home/fstagni/.cache/diracx/credentials.json
...Saved credentials to /home/fstagni/.cache/diracx/credentials.json

Login successful!
```

Submitting a job (using Python `requests`):
2. Submitting a job (using Python `requests`):

```python{1,3-8,10-28,30-32}{lines:true,maxHeight:'100px'}
```py
import requests

# Define the headers
Expand All @@ -424,51 +424,6 @@ headers = {
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXV ...',
'Content-Type': 'application/json',
}
# Define the data payload
data = [
"Arguments = \"jobDescription.xml -o LogLevel=INFO\";\n"
"Executable = \"dirac-jobexec\";\n"
"JobGroup = jobGroup;\n"
"JobName = jobName;\n"
"JobType = User;\n"
"LogLevel = INFO;\n"
"OutputSandbox =\n"
" {\n"
" Script1_CodeOutput.log,\n"
" std.err,\n"
" std.out\n"
" };\n"
"Priority = 1;\n"
"Site = ANY;\n"
"StdError = std.err;\n"
"StdOutput = std.out;"
]
# Send the POST request
response = requests.post('https://diracx-cert.app.cern.ch/api/jobs/', headers=headers, json=data)
```


Getting its status (using `curl`):

````md magic-move
```sh
curl -X 'GET' \
'https://diracx-cert.app.cern.ch/api/jobs/status?job_ids=8971' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXV ...' | jq
```

```json
{
"8971": {
"Status": "Done",
"MinorStatus": "Execution Complete",
"ApplicationStatus": "Unknown"
}
}

```


Expand Down Expand Up @@ -544,18 +499,18 @@ layout: top-title-two-cols
color: gray-light
align: c-lm-rm
title: proxies+tokens
columns: is-4
columns: is-3
---

:: title ::

# On proxies and tokens
# More on proxies and tokens

:: left ::

```mermaid {theme: 'forest', scale: 0.5}
```mermaid {theme: 'forest', scale: 0.4}
sequenceDiagram
title Tokens with standard OAuth2 flow
title DiracX: tokens with standard OAuth2 flow
create actor U as User
create participant DiracX
U->>DiracX: Login
Expand All @@ -574,9 +529,9 @@ DiracX delivers its own tokens, they are not the same tokens used for the Grid e

:: right ::

```mermaid {theme: 'forest', scale: 0.5}
```mermaid {theme: 'forest', scale: 0.4}
sequenceDiagram
title Working with proxy and token
title DIRAC+DiracX: Working with proxies and tokens
create actor U as User
create participant dirac-proxy-init
U->>dirac-proxy-init:
Expand Down

0 comments on commit 0d1a595

Please sign in to comment.