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

Add updated migration info and writing system #67

Merged
merged 12 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo Blog site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- blog

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.127.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: check stuff
working-directory: ./vyasa_blog
run: |
echo "Hello world, it's time to test the working directory: " && pwd
- name: Install Node.js dependencies
working-directory: ./vyasa_blog
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
TZ: America/Los_Angeles
working-directory: ./vyasa_blog
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./vyasa_blog/public


# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ npm-debug.log
# Any Secret Configs
/config/*.secret.exs
/venv/
**.DS_Store
/vyasa_blog/public/ltximg/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vyasa_blog/themes/PaperMod"]
path = vyasa_blog/themes/PaperMod
url = https://github.com/adityatelange/hugo-PaperMod
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blog.vyasa.tv
101 changes: 80 additions & 21 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,104 @@ Wherever there be anything you dost not comprehend, cease to continue writing
-- Vyasa, Adi Parva - Mahabharatam
#+END_QUOTE

### CLI Helpsheet

```elixir
* What is the _*Vyasa Project*_?
=TODO=

* Getting Started Locally
** Basic setup instructions
*** Pre-requisites
1. Language Setup for Elixir. For any development environment of your choice, setup the necessary LSPs for elixir.
2. Docker
3. AWS cli
We use minio for local setup. At least a dummy profile needs to be set up using the aws cli.

*** First Setup Steps
We first setup the servers that get run and then do teh data migration steps.

We can use the [[file:docs/migration_ritesh.livemd::Migration steps][livemarkdown here]] for the data migration steps.

1. start docker, use the [[file:docker-compose.yml][docker-compose file]] already available. This will start the minio, pg and the like
#+begin_quote sh
docker compose up
#+end_quote
2. init aws cli, use a dummy profile
writing to the =~/.aws/credentials= file will work as well:

#+begin_quote toml
[default]
aws_access_key_id = secrettunnel
aws_secret_access_key = secrettunnel
#+end_quote
3. create the s3 bucket that shall be used
#+begin_quote sh
aws --endpoint-url http://localhost:9000 s3 mb s3://vyasa
#+end_quote
4. install the elixir deps
#+begin_quote elixir
mix deps.get
#+end_quote
5. do an initial db migration
#+begin_quote elixir
mix ecto.setup
#+end_quote
6. [Data seeding] Seed the text, written and events
This requires us to use a .json dump. [[./scripts/wow.json][Here's an example]] of such a dump.

We also need some voices files to init the voices. The voices repo is a private repo for now, can be found [[https://github.com/ve1ld/voices][here]].

For an easier time, use [[file:docs/migration_ritesh.livemd][this livemarkdown]].

*** Starting Steps
1. Start aux services by running docker compose up
2. Start the vyasa server
#+begin_quote bash
iex --sname vyasa --cookie foofoo --dbg pry -S mix phx.server
#+end_quote



* CLI Scripts Helpsheet
** 1. Running the shlokam.org scraper
#+begin_quote elixir
# build script
mix escript.build
# fetch from domain/path --storage :mode
./vyasa fetch shlokam.org/hanumanchalisa --storage file
```
* Forms of Prior Art
** [[http://worrydream.com/refs/Nelson-ComputerLibDreamMachines1975.pdf#page=57][Xanadu Pattern ]]
#+end_quote

Ted Nelson the granddaddy of hypertext media, need I say more. The introduction to [[https://cs.brown.edu/people/nmeyrowi/LiteraryMachinesChapter2.pdf#page=12][Literary Machines]] is instructive to delineating the problem boundaries for literature
* Matter of Prior Work
We stand on the shoulders of giants. Here are some of the project that insipired this project into being started

** [[https://gwern.net/design][Design of Gwern.net]]
** Prior Art
*** [[http://www.shivkumar.org/music/Thiruppavai-04-AazhiMazhaiKanna-Varali.htm][Shivkumar's Archives]]

Gwern has incorporated sidenotes instead of footnotes on wide windows, drop caps, smallcaps, collapsible sections, automatic inflation-adjusted currency, Wikipedia-style link icons & infoboxes, custom syntax highlighting, extensive local archives to fight linkrot (archive engine), and an ecosystem of “popup”/“popin” annotations & previews of links for frictionless browsing—the net effect of hierarchical structures with collapsing and instant popup access to excerpts enables iceberg-like pages where most information is hidden but the reader can easily drill down as deep as they wish.
Shivkumar Kalyanaraman has compiled and archived a wealth of song recordings, paired with word-by-word meanings

** [[https://edwardtufte.github.io/tufte-css/][Tufte.css]]
*** [[https://shaivam.org/hindu-prayer-hub/detail/521][Shaivam]]

Edward Tufte has developed a distinctive style in his works: simple, with well-set typography, extensive sidenotes, and elegant representations of graphs and charts
Built and maintained by devotees since 1996 a wealth of textual archives

** [[https://ctext.org/introduction][CText]]
*** [[https://www.holy-bhagavad-gita.org/chapter/5/verse/8-9][Holy Bhagavad Gita]]

Dr. Donald Sturgeon has compiled a great corpus of ancient (in particular pre-Qin and Han dynasty) Chinese texts in an organized and searchable format which has been composed through an parallel passage interface, word lists for semantic linking and ancient text database.
A tremendous effort by Jagadguru Kripaluji Trust

** Forms of Prior Art as Inspiration
*** [[http://worrydream.com/refs/Nelson-ComputerLibDreamMachines1975.pdf#page=57][Xanadu Pattern ]]

** [[https://www.iwritewordsgood.com/apl/patterns/apl101.htm][Pattern Language]]
Ted Nelson the granddaddy of hypertext media, need I say more. The introduction to [[https://cs.brown.edu/people/nmeyrowi/LiteraryMachinesChapter2.pdf#page=12][Literary Machines]] is instructive to delineating the problem boundaries for literature

Christopher Alexander's pattern language arranges a series of steps, in a certain way that allows the process of unfolding to proceed. The rules are ordered – sequenced – to unfold each part of the environment being created, smoothly and coherently [[https://www.livingneighborhoods.org/ht-0/morphogenesis-two.htm][enlarging the whole]].
*** [[https://gwern.net/design][Design of Gwern.net]]

* Matter of Prior Art
** [[http://www.shivkumar.org/music/Thiruppavai-04-AazhiMazhaiKanna-Varali.htm][Shivkumar's Archives]]
Gwern has incorporated sidenotes instead of footnotes on wide windows, drop caps, smallcaps, collapsible sections, automatic inflation-adjusted currency, Wikipedia-style link icons & infoboxes, custom syntax highlighting, extensive local archives to fight linkrot (archive engine), and an ecosystem of “popup”/“popin” annotations & previews of links for frictionless browsing—the net effect of hierarchical structures with collapsing and instant popup access to excerpts enables iceberg-like pages where most information is hidden but the reader can easily drill down as deep as they wish.

Shivkumar Kalyanaraman has compiled and archived a wealth of song recordings, paired with word-by-word meanings
*** [[https://edwardtufte.github.io/tufte-css/][Tufte.css]]

** [[https://shaivam.org/hindu-prayer-hub/detail/521][Shaivam]]
Edward Tufte has developed a distinctive style in his works: simple, with well-set typography, extensive sidenotes, and elegant representations of graphs and charts

Built and maintained by devotees since 1996 a wealth of textual archives
*** [[https://ctext.org/introduction][CText]]

** [[https://www.holy-bhagavad-gita.org/chapter/5/verse/8-9][Holy Bhagavad Gita]]
Dr. Donald Sturgeon has compiled a great corpus of ancient (in particular pre-Qin and Han dynasty) Chinese texts in an organized and searchable format which has been composed through an parallel passage interface, word lists for semantic linking and ancient text database.

A tremendous effort by Jagadguru Kripaluji Trust
*** [[https://www.iwritewordsgood.com/apl/patterns/apl101.htm][Pattern Language]]
Christopher Alexander's pattern language arranges a series of steps, in a certain way that allows the process of unfolding to proceed. The rules are ordered – sequenced – to unfold each part of the environment being created, smoothly and coherently [[https://www.livingneighborhoods.org/ht-0/morphogenesis-two.htm][enlarging the whole]].
73 changes: 36 additions & 37 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
version: '3.8'

services:
# postgres:
# container_name: postgres_container
# image: postgres
# environment:
# POSTGRES_USER: ${POSTGRES_USER:-postgres}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root}
# PGDATA: /data/postgres
# volumes:
# - postgres:/data/postgres
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U postgres"]
# interval: 10s
# timeout: 5s
# retries: 5
# ports:
# - "5432:5432"
# networks:
# - postgres
# restart: unless-stopped

# pgadmin:
# container_name: pgadmin_container
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-root}
# PGADMIN_CONFIG_SERVER_MODE: 'False'
# volumes:
# - pgadmin:/var/lib/pgadmin
postgres:
container_name: postgres_container
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
networks:
- postgres
restart: unless-stopped

# ports:
# - "${PGADMIN_PORT:-5050}:80"
# networks:
# - postgres
# restart: unless-stopped
pgadmin:
container_name: pgadmin_container
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-root}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres
restart: unless-stopped

minio1:
image: minio/minio:RELEASE.2022-05-08T23-50-31Z
Expand All @@ -53,9 +52,9 @@ services:
timeout: 20s
retries: 3

# networks:
# postgres:
# driver: bridge
networks:
postgres:
driver: bridge

volumes:
postgres:
Expand Down
Loading