Skip to content
Snippets Groups Projects
Commit 4d0b3cbc authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

update

parent 4ad32906
No related branches found
No related tags found
No related merge requests found
---
title: Getting Started
slug: /
---
## Step 1: Start ASAPO services
If you already have a running ASAPO and know the endpoint, you can skip to the step 2
<details><summary>Expand</summary>
<div>
```shell link="getting_started/start_asapo_container.sh" title="start_asapo_container.sh"
```
</div>
</details>
## Step 2: Start your Docusaurus site
Run the development server in the newly created `my-website` folder:
Open `docs/getting-started.md` and edit some lines. The site reloads automatically and display your changes.
## That's it!
Congratulations! You've successfully run and modified your Docusaurus project.
---
title: Getting Started
slug: /
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
## Step 1: Start ASAPO services {#step-1}
If you already have running ASAPO services and know the endpoint, you can skip to the [step 2](#step-2).
Otherwise, for testing purposes one can start ASAPO services in a standalone mode (this is not recommended for production deployment).
The easiest way is to use a Docker container.
So, make sure Docker is installed and you have necessary permissions to use it.
Please note that this will only work on a Linux machine. Also please note that ASAPO needs some ports to be available. You can check the list
[here](https://stash.desy.de/projects/ASAPO/repos/asapo/browse/deploy/asapo_services/scripts/asapo.auto.tfvars.in?at={ASAPO_VERSION}#37).
Now, depending on how your Docker daemon is configured (if it uses a
unix socket or a tcp port for communications)
you can use pick corresponding script below, adjust and execute it to start ASAPO services.
<Tabs
defaultValue="unix"
values={[
{ label: 'Docker with unix socket (default)', value: 'unix', },
{ label: 'Docker with tcp (used on FS machines)', value: 'tcp', },
]
}>
<TabItem value="unix">
```shell link="getting_started/start_asapo_socket.sh" title="start_asapo_socket.sh"
```
</TabItem>
<TabItem value="tcp">
```shell link="getting_started/start_asapo_tcp.sh" title="start_asapo_tcp.sh"
```
</TabItem>
</Tabs>
at the end you should see
<p className="green-text"><strong>Apply complete! Resources: 19 added, 0 changed, 0 destroyed.</strong></p>
which means ASAPO services successfully started. Your ASAPO endpoint for API calls will be **localhost:8400**.
### Create data directories
Next, you need to create directories where ASAPO will store the data
(the structure matches the one used at DESY experiments).
Since we are going to use beamline `test` and beamtime `asapo_test` in following examples,
we must create two folders, one for the beamline filesystem and one for the core file system:
```shell
ASAPO_HOST_DIR=/var/tmp/asapo # the folder used in step 1
mkdir -p $ASAPO_HOST_DIR/global_shared/online_data/test/current/raw
mkdir -p $ASAPO_HOST_DIR/global_shared/data/test_facility/gpfs/test/2019/data/asapo_test
```
:::note ASAP::O in production mode
We have a running instance for processing data collected during beamtimes. Please get in touch with FS-SC group for more information.
:::
## Step 2: Install client libraries {#step-2}
Now you can install Python packages or C++ libraries for ASAPO Producer and Consumer API (you need to be in DESY intranet to access files).
<Tabs
defaultValue="python-pip"
values={[
{ label: 'Python - pip', value: 'python-pip', },
{ label: 'Python - packages', value: 'python-packages', },
{ label: 'C++ packages', value: 'cpp', },
]
}>
<TabItem value="python-pip">
```shell link="getting_started/install_python_clients_pip.sh"
```
</TabItem>
<TabItem value="python-packages">
```shell link="getting_started/install_python_clients_pkg.sh"
```
</TabItem>
<TabItem value="cpp">
```shell link="getting_started/install_cpp_clients.sh"
```
</TabItem>
</Tabs>
Run the development server in the newly created `my-website` folder:
Open `docs/getting-started.md` and edit some lines. The site reloads automatically and display your changes.
## Step 3: Produce a message {#step-34}
## Step 4: Consume a message {#step-34}
## Step 5: Clean-up
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
@ASAPO_VERSION@
<Tabs
defaultValue="js"
values={[
{ label: 'JavaScript', value: 'js', },
{ label: 'JavaScript', value: 'js2', },
{ label: 'Python', value: 'py', },
{ label: 'Java', value: 'java', },
]
}>
<TabItem value="js">
```jsx {1} link="getting_started/build.sh" snippetTag="#snippet1" title="/src/components/HelloCodeTitle.js"
```
</TabItem>
<TabItem value="js2">
```jsx {1} link="./assets/build.sh" snippetTag="#snippet2" title="/src/components/HelloCodeTitle.js"
```
</TabItem>
<TabItem value="py">
```py
def hello_world():
print 'Hello, world!'
```
</TabItem>
<TabItem value="java">
```java
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello, World");
}
}
```
</TabItem>
</Tabs>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module.exports = { module.exports = {
title: 'ASAP::O', title: 'ASAP::O',
tagline: 'High performance distributed streaming platform', tagline: 'High performance distributed streaming platform',
url: 'https://asapo.desy.de', url: 'http://asapo.desy.de',
baseUrl: '/', baseUrl: '/',
onBrokenLinks: 'warn', onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn', onBrokenMarkdownLinks: 'warn',
...@@ -33,11 +33,11 @@ module.exports = { ...@@ -33,11 +33,11 @@ module.exports = {
items: [ items: [
{ {
label: 'C++', label: 'C++',
href: 'http://os-46-asapo-docs.desy.de/cpp/', href: 'http://asapo.desy.de/cpp/',
}, },
{ {
label: 'Python', label: 'Python',
href: 'http://os-46-asapo-docs.desy.de/python/', href: 'http://asapo.desy.de/python/',
}, },
], ],
}, },
......
module.exports = { module.exports = {
docs: [ docs: [
'getting-started',
{ {
type: 'category', type: 'category',
label: 'Docusaurus Tutorial', label: 'Docusaurus Tutorial',
items: [ items: [
'getting-started',
'create-a-page', 'create-a-page',
'create-a-document', 'create-a-document',
'create-a-blog-post', 'create-a-blog-post',
'markdown-features', 'markdown-features',
'thank-you', 'thank-you',
'test',
], ],
}, },
], ],
......
...@@ -45,4 +45,12 @@ ...@@ -45,4 +45,12 @@
.navbar .navbar__link[href*=stash]:before { .navbar .navbar__link[href*=stash]:before {
background-image: url('/static/img/bitbucket.svg'); background-image: url('/static/img/bitbucket.svg');
} }
\ No newline at end of file
details {
margin-bottom: 20px;
}
.green-text {
color: #32CD32;
}
...@@ -10,7 +10,8 @@ const initialFetchResult = 'loading...'; ...@@ -10,7 +10,8 @@ const initialFetchResult = 'loading...';
const noteStyle: React.CSSProperties = { const noteStyle: React.CSSProperties = {
textAlign: 'right', textAlign: 'right',
fontSize: '.8em' fontSize: '.8em',
marginTop: '-20px'
} }
export interface State { export interface State {
...@@ -39,7 +40,7 @@ async function fetchCode (url: string,snippetTag:string, state: State,setFetchRe ...@@ -39,7 +40,7 @@ async function fetchCode (url: string,snippetTag:string, state: State,setFetchRe
} }
let body = (await res.text()).split('\n') let body = (await res.text()).split('\n')
const fromLine = body.indexOf(snippetTag+" start") + 1 || 1; const fromLine = body.indexOf(snippetTag+" start") + 1 || 0;
const toLine = body.indexOf(snippetTag+ " end",fromLine) -1 || undefined; const toLine = body.indexOf(snippetTag+ " end",fromLine) -1 || undefined;
body = body.slice(fromLine, (toLine || fromLine) + 1) body = body.slice(fromLine, (toLine || fromLine) + 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment