Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: feat(quickstarts): initial migration of quickstarts content #9

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
521fa64
feat(quickstarts): initial migration of quickstarts content
owilliams320 May 17, 2024
eed138a
fix(quickstarts): build errors
owilliams320 May 17, 2024
1932a02
fix(quickstarts): build errors
owilliams320 May 17, 2024
ab84417
fix(pr): preview url
owilliams320 May 17, 2024
8e6e3fd
fix(quickstarts): build errors
owilliams320 May 17, 2024
c93c562
fix(quickstarts): build errors
owilliams320 May 17, 2024
19c538b
fix(quickstarts): converting drafts
owilliams320 May 17, 2024
0a2d9ec
fiz(build): invalid dates
owilliams320 May 17, 2024
ca9d385
fix(quickstarts): updating draft status
owilliams320 May 20, 2024
6caa5f6
add-sidebar
May 23, 2024
a277437
delete _category_
May 23, 2024
e9f7cdd
fix-sidebar
May 28, 2024
aa174be
no sidebar on file sidebar.js
May 28, 2024
f3f49a1
Merge pull request #14 from ObedVega/feat/add-quickstarts
ObedVega May 28, 2024
485f1ce
Merge branch 'main' into feat/add-quickstarts
ObedVega May 28, 2024
ad8815a
quickstarts index page
May 29, 2024
8f0e97b
quickstarts index page
May 29, 2024
63759c9
Merge branch 'feat/add-quickstarts' of https://github.com/ObedVega/ai…
May 29, 2024
3d1ab3b
quickstarts index page
May 29, 2024
cb1f200
Merge pull request #17 from ObedVega/feat/add-quickstarts
ObedVega May 29, 2024
c519636
hero images
May 29, 2024
f80ccbf
Merge pull request #18 from ObedVega/feat/add-quickstarts
ObedVega May 29, 2024
ef2253e
adding missing articules-1
Jun 11, 2024
9ebe9af
adding missing articles-2
Jun 12, 2024
63c3647
Merge pull request #26 from ObedVega/feat/add-quickstarts
ObedVega Jun 12, 2024
5b09414
youtube domain
Jun 12, 2024
09d5b3e
Merge pull request #28 from ObedVega/feat/add-quickstarts
ObedVega Jun 12, 2024
0dc78d6
Merge branch 'main' into feat/add-quickstarts
Jun 12, 2024
a8c5719
Merge branch 'feat/add-quickstarts' of https://github.com/ObedVega/ai…
Jun 12, 2024
1db35e9
Merge branch 'main' into feat/add-quickstarts
ObedVega Jun 12, 2024
a78910f
Merge pull request #30 from ObedVega/feat/add-quickstarts
ObedVega Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 12 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ const config = {
attributes: {
'http-equiv': 'Content-Security-Policy',
content:
"default-src 'self' 'unsafe-inline' 'unsafe-eval' data: https://avatars.githubusercontent.com https://github.com https://kit.fontawesome.com/ https://ka-f.fontawesome.com/ https://fonts.googleapis.com/ https://fonts.gstatic.com/ https://www.google-analytics.com/ https://www.googletagmanager.com/ https://*.algolia.net/;",
"default-src 'self' 'unsafe-inline' 'unsafe-eval' data: https://avatars.githubusercontent.com https://github.com https://kit.fontawesome.com/ https://ka-f.fontawesome.com/ https://fonts.googleapis.com/ https://fonts.gstatic.com/ https://www.youtube.com/ https://www.google-analytics.com/ https://www.googletagmanager.com/ https://*.algolia.net/;",
},
},
{
// Load font awesome icons
tagName: 'script',
attributes: {
defer: 'true',
src: 'https://kit.fontawesome.com/17a35e44e3.js',
crossorigin: 'anonymous',
},
Expand Down Expand Up @@ -88,6 +89,15 @@ const config = {
path: './releases',
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'quickstarts',
path: 'quickstarts',
routeBasePath: 'quickstarts',
sidebarPath: './sidebars.js',
},
],
],

presets: [
Expand Down Expand Up @@ -160,7 +170,7 @@ const config = {
title: 'Developers',
navItems: [
{
href: 'https://quickstarts.teradata.com/',
href: `${baseUrl}/quickstarts/business-intelligence/create-stunning-visualizations-in-power-bi-using-data-from-teradata-vantage/`,
label: 'Getting started',
},
{
Expand Down
11 changes: 11 additions & 0 deletions quickstarts/_partials/_clone-repo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


The `deployments` folder in the [AI Unlimited GitHub repository](https://github.com/Teradata/ai-unlimited) that Teradata provides contains template, parameter, and policy files for installing AI Unlimited.

Open a terminal window, and clone the repository.

``` bash
git clone https://github.com/Teradata/ai-unlimited
```


3 changes: 3 additions & 0 deletions quickstarts/_partials/community_link.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:::note
If you have any questions or need further assistance, please visit our [community forum](https://support.teradata.com/community) where you can get support and interact with other community members.
:::
9 changes: 9 additions & 0 deletions quickstarts/_partials/getting-started-intro.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import UseCase from './use-csae.mdx';

<UseCase />
## Overview
This how-to shows how to gain access to a Teradata database by running it on your local machine. Once you finish the steps you will have a working Teradata Vantage Express database on your computer.

:::note
Starting with version 17.20, Vantage Express includes the following analytics packages: [Vantage Analytics Library](https://docs.teradata.com/r/Vantage-Analytics-Library-User-Guide/January-2022), [Bring Your Own Model (BYOM)](https://docs.teradata.com/r/Teradata-VantageTM-Bring-Your-Own-Model-User-Guide/May-2022), [API Integration with AWS SageMaker](https://docs.teradata.com/r/Teradata-VantageTM-API-Integration-Guide-for-Cloud-Machine-Learning/April-2022).
:::
54 changes: 54 additions & 0 deletions quickstarts/_partials/getting-started-queries.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
```sql
CREATE DATABASE HR
AS PERMANENT = 60e6, -- 60MB
SPOOL = 120e6; -- 120MB
```

5. Let’s create a sample table and insert some data and query it. We will first create a table to hold employee information:

```sql
CREATE SET TABLE HR.Employees (
GlobalID INTEGER,
FirstName VARCHAR(30),
LastName VARCHAR(30),
DateOfBirth DATE FORMAT 'YYYY-MM-DD',
JoinedDate DATE FORMAT 'YYYY-MM-DD',
DepartmentCode BYTEINT
)
UNIQUE PRIMARY INDEX ( GlobalID );
```

6. Now, let's insert a record:

```sql
INSERT INTO HR.Employees (
GlobalID,
FirstName,
LastName,
DateOfBirth,
JoinedDate,
DepartmentCode
)
VALUES (
101,
'Adam',
'Tworkowski',
'1980-01-05',
'2004-08-01',
01
);
```

7. Finally, let's see if we can retrieve the data:

```sql
SELECT * FROM HR.Employees;
```

You should get the following results:

```sql
GlobalID FirstName LastName DateOfBirth JoinedDate DepartmentCode
-------- --------- ---------- ----------- ---------- --------------
101 Adam Tworkowski 1980-01-05 2004-08-01 1
```
3 changes: 3 additions & 0 deletions quickstarts/_partials/getting-started-summary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Summary

In this guide we have covered how to quickly create a working Teradata environment. We used Teradata Vantage Express in a VM running on VMware. In the same VM, we ran Teradata Studio Express to issue queries. We installed all software locally and didn't have to pay for cloud resources.
112 changes: 112 additions & 0 deletions quickstarts/_partials/install-ve-in-public.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import GettingStartedQueries from './getting-started-queries.mdx';

run. Install VirtualBox and 7zip:
```bash
apt update && apt-get install p7zip-full p7zip-rar virtualbox -y
```
5. Retrieve the curl command to download Vantage Express.
* Go to [Vantage Expess download page](https://downloads.teradata.com/download/database/teradata-express-for-vmware-player) (registration required).
* Click on the latest download link, e.g. "Vantage Express 17.20". You will see a license agreement popup. Don't accept the license yet.
* Open the network view in your browser. For example, in Chrome press kbd:[F12] and navigate to `Network` tab:

![Browser Network Tab](../images/browser.network.png)

* Accept the license by clicking on `I Agree` button and cancel the download.
* In the network view, find the last request that starts with `VantageExpress`. Right click on it and select `Copy -> Copy as cURL`:

![Browser Copy culr](../images/browser.copy.curl.png)
* Head back to the ssh session and download Vantage Express by pasting the curl command. Add `-o ve.7z` to the command to save the download to file named `ve.7z`. You can remove all the HTTP headers, e.g.:

```bash
curl -o ve.7z 'http://d289lrf5tw1zls.cloudfront.net/database/teradata-express/VantageExpress17.20_Sles12_202108300444.7z?Expires=1638719978&Signature=GKBkNvery_long_signature__&Key-Pair-Id=********************'
```

* Unzip the downloaded file. It will take several minutes:

```bash
7z x ve.7z
```
* Start the VM in VirtualBox. The command will return immediately but the VM init process will take several minutes:

```bash
export VM_IMAGE_DIR="/opt/downloads/VantageExpress17.20_Sles12"
DEFAULT_VM_NAME="vantage-express"
VM_NAME="${VM_NAME:-$DEFAULT_VM_NAME}"
vboxmanage createvm --name "$VM_NAME" --register --ostype openSUSE_64
vboxmanage modifyvm "$VM_NAME" --ioapic on --memory 6000 --vram 128 --nic1 nat --cpus 4
vboxmanage storagectl "$VM_NAME" --name "SATA Controller" --add sata --controller IntelAhci
vboxmanage storageattach "$VM_NAME" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$(find $VM_IMAGE_DIR -name '*disk1*')"
vboxmanage storageattach "$VM_NAME" --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium "$(find $VM_IMAGE_DIR -name '*disk2*')"
vboxmanage storageattach "$VM_NAME" --storagectl "SATA Controller" --port 2 --device 0 --type hdd --medium "$(find $VM_IMAGE_DIR -name '*disk3*')"
vboxmanage modifyvm "$VM_NAME" --natpf1 "tdssh,tcp,,4422,,22"
vboxmanage modifyvm "$VM_NAME" --natpf1 "tddb,tcp,,1025,,1025"
vboxmanage startvm "$VM_NAME" --type headless
vboxmanage controlvm "$VM_NAME" keyboardputscancode 1c 1c
```
* ssh to Vantage Express VM. Use `root` as password:

```bash
ssh -p 4422 root@localhost
```
* Validate that the DB is up:
```bash
pdestate -a
```

If the command returns `PDE state is RUN/STARTED. DBS state is 5: Logons are enabled - The system is quiescent`, it means that Vantage Express has started.
If the status is different, repeat `pdestate -a` till you get the correct status.

* Once Vantage Express is up and running, start `bteq` client command line client. BTEQ (pronounced “bee-teek”) is a general-purpose, command-based client tool used to submit SQL queries to a Teradata Database.

```bash
bteq
```
* Once in bteq, connect to your Vantage Express instance. When asked for the password, enter `dbc`:

```bash
.logon localhost/dbc
```

## Run sample queries

* Using `dbc` user, we will create a new database called `HR`. Copy/paste this query and run press kbd:[Enter]:

<GettingStartedQueries />

## Optional setup

* If you intend to stop and start the VM, you may want to add Vantage Express to autostart. ssh to your VM and run the following commands:

```bash
sudo -i

cat <<EOF >> /etc/default/virtualbox
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
EOF

cat <<EOF > /etc/systemd/system/vantage-express.service
[Unit]
Description=vm1
After=network.target virtualbox.service
Before=runlevel2.target shutdown.target
[Service]
User=root
Group=root
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/usr/bin/VBoxManage startvm vantage-express --type headless
ExecStop=/usr/bin/VBoxManage controlvm vantage-express savestate
[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable vantage-express
systemctl start vantage-express
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:::note
This how-to shows you how to add Teradata Extensions to a Jupyter Notebooks environment. A hosted version of Jupyter Notebooks integrated with Teradata Extensions and analytics tools is available for functional testing for free at https://clearscape.teradata.com.
:::
Loading