Skip to content

Commit d87d479

Browse files
committed
infra: Change rendering engine from Docusaurus to Jekyll
- Remove `chapters/` hierarchy, `config.yaml` and `gen-view.py`. - Re-split lab content into individual labs under `labs/lab-<number>/`. - Add `_config.yaml` Gemfile for Jekyll. - Update `Makefile` and `Dockerfile` to build the container and serve the website with Jekyll. - Update the information in the global `README.md`. - Replace topic/chapter labels with lab-based ones. - Update PR rendering for Jekyll.
1 parent 5db2ced commit d87d479

File tree

2,478 files changed

+22646
-43569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,478 files changed

+22646
-43569
lines changed

.github/workflows/os-runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
contents: read
1818

1919
steps:
20-
- name: Checkout
20+
- name: Checkout
2121
uses: actions/checkout@v3
2222

2323
- name: Set up QEMU

.github/workflows/pr-deployment.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ jobs:
1919
repository: ${{ github.event.pull_request.head.repo.full_name }}
2020
ref: ${{ github.head_ref }}
2121

22-
- run: |
23-
cd repo
24-
REF=$(echo ${{ github.event.number }} | sed 's/\//\\\//g')
25-
sed -i "s/baseUrl: \/operating-systems\//baseUrl: \/operating-systems\/$REF\//" config.yaml
26-
2722
- name: Set up Docker Buildx
2823
uses: docker/setup-buildx-action@v1
2924

@@ -34,15 +29,15 @@ jobs:
3429
file: ./repo/Dockerfile
3530
push: false
3631
load: true
37-
tags: operating-systems/docusaurus:latest
32+
tags: operating-systems-${{ github.event.number }}:latest
3833
cache-from: type=gha
3934
cache-to: type=gha
4035

4136
- name: Load Image
4237
run: |
4338
mkdir -p ${{ github.event.number }}
4439
docker image list
45-
docker run -v $GITHUB_WORKSPACE/repo:/content -v $GITHUB_WORKSPACE/${{ github.event.number }}:/output operating-systems/docusaurus:latest
40+
docker run -v $GITHUB_WORKSPACE/repo:/usr/src/app operating-systems-${{ github.event.number }}:latest
4641
4742
# Popular action to deploy to GitHub Pages:
4843
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus

.gitignore

Lines changed: 12 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -76,109 +76,15 @@ dkms.conf
7676
# reveal-md slides output folder
7777
_site/
7878

79-
# Temporary files
80-
*.swp
81-
*.swo
82-
*~
83-
slides.md
84-
85-
# .gif files generated with ffmpeg
86-
*-generated.gif
87-
88-
# JavaScript files
89-
90-
# compiled output
91-
/dist
92-
/tmp
93-
/out-tsc
94-
95-
# Runtime data
96-
pids
97-
*.pid
98-
*.seed
99-
*.pid.lock
100-
101-
# Directory for instrumented libs generated by jscoverage/JSCover
102-
lib-cov
103-
104-
# Coverage directory used by tools like istanbul
105-
coverage
106-
107-
# nyc test coverage
108-
.nyc_output
109-
110-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
111-
.grunt
112-
113-
# Bower dependency directory (https://bower.io/)
114-
bower_components
115-
116-
# node-waf configuration
117-
.lock-wscript
118-
119-
# IDEs and editors
120-
.idea
121-
.project
122-
.classpath
123-
.c9/
124-
*.launch
125-
.settings/
126-
*.sublime-workspace
127-
128-
# IDE - VSCode
129-
.vscode/*
130-
!.vscode/settings.json
131-
!.vscode/tasks.json
132-
!.vscode/launch.json
133-
!.vscode/extensions.json
134-
135-
# misc
136-
.sass-cache
137-
connect.lock
138-
typings
139-
140-
# Logs
141-
logs
142-
*.log
143-
npm-debug.log*
144-
yarn-debug.log*
145-
yarn-error.log*
146-
147-
# Dependency directories
148-
node_modules/
149-
jspm_packages/
150-
151-
# Optional npm cache directory
152-
.npm
153-
154-
# Optional eslint cache
155-
.eslintcache
156-
157-
# Optional REPL history
158-
.node_repl_history
159-
160-
# Output of 'npm pack'
161-
*.tgz
162-
163-
# Yarn Integrity file
164-
.yarn-integrity
165-
166-
# dotenv environment variables file
167-
.env
168-
169-
# next.js build output
170-
.next
171-
172-
# Lerna
173-
lerna-debug.log
174-
175-
# System Files
176-
.DS_Store
177-
Thumbs.db
178-
179-
# Docusaurus build files
180-
.output/
181-
.view/
182-
183-
# VSCode
184-
.vscode/
79+
# Builder output folder
80+
/.output/
81+
82+
# Ruby files for the local Jekyll server
83+
.sass-cache/
84+
.jekyll-cache/
85+
.jekyll-metadata
86+
87+
# Ignore folders generated by Bundler
88+
.bundle/
89+
vendor/
90+
*.lock

Dockerfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
FROM ghcr.io/open-education-hub/openedu-builder:0.6.1
1+
FROM ruby:3.0-slim
22

3-
# Install ffmpeg
4-
RUN apt-get update && \
5-
apt-get install -y ffmpeg curl make
3+
RUN apt-get update && apt-get install -y \
4+
build-essential \
5+
zlib1g-dev \
6+
&& rm -rf /var/lib/apt/lists/*
67

7-
# Install markdown-pp
8-
RUN pip install MarkdownPP
8+
WORKDIR /usr/src/app
99

10-
# Install node LTS (16)
11-
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
12-
apt-get install -y nodejs
10+
COPY Gemfile Gemfile.lock ./
11+
RUN gem install bundler
12+
RUN bundle install
1313

14-
# Install reveal md
15-
RUN npm install -g reveal-md
14+
EXPOSE 4000
1615

17-
# Install docusaurus
18-
RUN npm install [email protected]
19-
20-
WORKDIR /content
21-
22-
ENTRYPOINT ["oe_builder"]
16+
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem 'jekyll-titles-from-headings'
6+
gem 'jekyll-seo-tag'
7+
gem 'jekyll-remote-theme'
8+
gem 'github-pages', group: :jekyll_plugins

Makefile

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,20 @@
1-
REPO_NAME = operating-systems
2-
IMAGE_NAME = $(REPO_NAME)/docusaurus:latest
3-
CONTAINER_NAME = open-edu-hub-$(REPO_NAME)-bash
4-
OUTPUT_DIR = $$PWD/.output/$(REPO_NAME)
1+
IMG_NAME=$(shell basename $(CURDIR))
2+
CONT_NAME=$(IMG_NAME)
53

6-
.PHONY: all buildimg build serve run_bash enter_bash stop_bash clean cleanall
7-
8-
all: build
9-
10-
buildimg:
11-
docker build -f ./Dockerfile --tag $(IMAGE_NAME) .
12-
13-
build: buildimg
14-
@echo "Building content. This will take a while (several minutes) ..."
15-
@echo "After the build, run"
16-
@echo ""
17-
@echo " make serve"
18-
@echo ""
19-
@mkdir -p $(OUTPUT_DIR)
20-
docker run --rm -v $$PWD/:/content -v $(OUTPUT_DIR):/output $(IMAGE_NAME)
4+
build:
5+
docker build -t $(IMG_NAME) .
216

227
serve:
23-
@echo "Point your browser to http://localhost:8080/$(REPO_NAME)"
24-
@cd $(OUTPUT_DIR)/.. && python3 -m http.server 8080
25-
26-
run_bash: buildimg
27-
@mkdir -p $(OUTPUT_DIR)
28-
docker run -d -it --entrypoint /bin/bash --name $(CONTAINER_NAME) -v $$PWD/:/content -v $(OUTPUT_DIR):/output $(IMAGE_NAME)
29-
30-
enter_bash:
31-
docker exec -it $(CONTAINER_NAME) /bin/bash
32-
33-
stop_bash:
34-
-test "$(shell docker container inspect -f '{{.State.Running}}' $(CONTAINER_NAME) 2> /dev/null)" = "true" && docker stop $(CONTAINER_NAME)
8+
docker run --rm -p 4000:4000 -v $$PWD:/usr/src/app $(IMG_NAME)
359

36-
clean: stop_bash
37-
-docker container inspect $(CONTAINER_NAME) > /dev/null 2>&1 && docker rm $(CONTAINER_NAME)
38-
-sudo rm -fr $(OUTPUT_DIR)
10+
stop:
11+
@docker ps -q --filter "name=$(CONT_NAME)" | grep -q . && docker stop $(CONT_NAME) \
12+
|| echo "No running container to stop."
3913

40-
cleanall: clean
41-
-docker inspect --type=image $(IMAGE_NAME) > /dev/null 2>&1 && docker image rm $(IMAGE_NAME)
14+
clean: stop
15+
docker rmi $(IMG_NAME)
16+
rm -rf _site
4217

43-
# Linters
4418
.PHONY: lint typos
4519
lint: typos
4620

README.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
nav_order: 1
3+
---
4+
15
# Operating Systems (OER)
26

37
[![copying.md](https://img.shields.io/static/v1?label=license&message=CCBY-SA4.0&color=%23385177)](https://github.com/open-education-hub/operating-systems/blob/master/COPYING.md)
@@ -13,36 +17,28 @@ They are to be used by teachers, trainers, students and hobbyists who want to le
1317

1418
## Using the Content
1519

16-
Content is located in the `content/` folder.
17-
It currently consists of 5 chapters:
18-
19-
* [Software Stack](content/chapters/software-stack/)
20-
* [Data](content/chapters/data/)
21-
* [Compute](content/chapters/compute/)
22-
* [Input/Output](content/chapters/io/)
23-
* [Application Interaction](content/chapters/app-interact/)
24-
25-
Each chapter has its own folder.
26-
Content for each chapter is split in two subfolders:
27-
28-
* `lecture/`: content to be presented and discussed as part of lectures
29-
* `lab/`: content to be worked on as practical activities during labs / seminars
30-
31-
Lecture content is expected to be presented and followed.
32-
Lab content is expected to be used as practice work.
33-
34-
## Chapter Contents
35-
36-
Lecture content consists of slides and demos.
37-
Slides are written in [GitHub Markdown](https://guides.github.com/features/mastering-markdown/) and use [reveal-md](https://github.com/webpro/reveal-md) and [reveal.js](https://revealjs.com/) to render HTML output.
38-
Lecture slides are built from the `slides.md` file using the `make` command (and the `Makefile`).
39-
Demos are snippets of code and support files that showcase concepts and ideas related to the lecture.
40-
Demos are located in the `demo/` folder.
41-
Each demo has its own folder with source code, `Makefile` or other build files (if required) and support files.
42-
43-
Lab content consists of lab text and lab activities.
44-
Lab text is placed in the `README.md` file.
45-
Each lab activity has its own folder with source code, `Makefile` or other build files (if required) and support files.
20+
The content is built using [Jekyll](https://jekyllrb.com/) and is hosted on [GitHub Pages](https://pages.github.com/).
21+
It consists of 5 main sections:
22+
23+
* Software Stack
24+
* [Lab 1 - Operating System Perspective](labs/lab-01/)
25+
* [Lab 2 - Library Perspective](labs/lab-02/)
26+
* Data
27+
* [Lab 3 - Memory](labs/lab-03/)
28+
* [Lab 4 - Investigate Memory](labs/lab-04/)
29+
* [Lab 5 - Memory Security](labs/lab-05/)
30+
* Compute
31+
* [Lab 6 - Multiprocess and Multithread](labs/lab-06/)
32+
* [Lab 7 - Copy-on-Write](labs/lab-07/)
33+
* [Lab 8 - Synchronization](labs/lab-08/)
34+
* Input/Output
35+
* [Lab 9 - File Descriptors](labs/lab-09/)
36+
* [Lab 10 - Inter-Process Communication](labs/lab-10/)
37+
* [Lab 11 - IO Optimizations](labs/lab-11/)
38+
* Application Interaction
39+
* [Lab 12 - Application Interaction](labs/lab-12/)
40+
41+
Each chapter has a dedicated assignment in the [`assignments/`](assignments/) folder.
4642

4743
## Contributing
4844

_config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: CC BY-SA 4.0
2+
3+
title: Operating Systems
4+
remote_theme: just-the-docs/just-the-docs
5+
repository: cs-pub-ro/operating-systems
6+
7+
exclude:
8+
- README.md
9+
- REVIEWING.md
10+
- config.yaml
11+
- chapters/
12+
- .git/
13+
- .vscode/
14+
- .github/
15+
- content/
16+
- util/
17+
- landing-page/
18+
- .view/
19+
- .output/
20+
21+
plugins:
22+
- jekyll-titles-from-headings
23+
- jekyll-seo-tag
24+
25+
callouts:
26+
warning:
27+
title: warning
28+
color: yellow
29+
tip:
30+
title: tip
31+
color: green

assignments/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Assignments
3+
nav_order: 3
4+
has_children: true
5+
---
6+
7+
# Assignments
8+
9+
The assignments are a way to test your understanding of the course material.
10+
Each assignment is a small project that encompasses the concepts you have learned in the labs.
11+
12+
Each assignment compreises of:
13+
14+
- a description of the assignment in the `README.md` file
15+
- a `src/` directory that contains the code skeleton for the assignment
16+
- a `tests/` directory that contains the test cases for the assignment
17+
- optionally a `utils/` directory that contains utility functions that should not be changed
18+
19+
You can find the assignments in the `assignments` directory.
20+
21+
## Building and Testing the Assignments
22+
23+
Each assignment has its own Makefile to automate the building and testing process.
24+
For more details on how to use it, check the `README.md` file in the assignment directory.

0 commit comments

Comments
 (0)