Toolboxes-Docs (vibe-kanban c5c3e68d)
TSYS Group Development Stack - Toolboxes - DocsAndDiagrams - Product Requirements Document - ## Docker Image Boilerplate Image name: tsysdevstack-toolboxes-docs Image username: tsysdevstack Image base: latest Debian stable - ALL operations MUST be as the tsysdevstack user - NO ROOT ACCESS should be possible at runtime (no sudo, no su) - The ONLY permitted use of root is during build time, and that MUST be to the ABSOLUTE MINIMUM extent possible (just for apt-get operations and creating the tsysdevstack user). Switching to tsysdevstack as early as possible. - mise (as the tsysdevstack user) MUST be used to install all language runtimes (node/python/rust/ruby). - If an application is installed via npm/pip/cargo/gem, those application installs MUST be done via mise managed versions of npm/pip/cargo/gem. - NO system wide (apt-get) installs of language runtimes are allowed - This is a production container. Use ALL best common practices for the building and securing of docker containers. (Buildx, multi stage, hardened ) - Use yamllint/hadolint/shellcheck (available via docker images on this system) as a QA gate BEFORE attempting to build the image. If ANY changes to Dockerfile/run.sh/build.sh/test.sh are made, run them through hadolint/shellcheck respectively. - ALL hadolint/yamllint/shellcheck issues MUST be FULLY RESOLVED always. The only acceptable QA outcome is when those tools return no warnings/errors. - Think about how to efficiently create the Dockerfile, keeping caching of layers in mind , especially how layers can be cached across multiple different image builds. - Utilize buildkit/buildx - This container needs to run on PC/Raspberry Pi/Mac M series. - Reproducibility of the build is PARAMOUNT! Use version pinning for EVERYTHING. Do the research to find the latest stable version and update Dockerfile and other files accordingly. Do not "just use latest", that is never acceptable. You MUST pin the Debian package versions, and any of the tooling you install via mise managed runtimes. - Use the examples subdirectory and create example artifacts and workflow scripts to fully QA the functionality of the container - Create a README.md file that is BEAUTIFULLY formatted (using table of contents/headers/icons/graphics/whitespace/tables (with left justified text)). Document the container image thoroughly. - Use the documentation subdirectory and creaate the following artifacts: - TROUBLESHOOTING.md - CHEATSHEET.md - USAGE.md - Use the output subdirectory and create the following artifacts (ensure they will pass strict QA testing/auditing): - Dockerfile - docker-compose.yml - devcontainer.json - run.sh - build.sh - test.sh ## Docker Image Requirements The overall purpose of this container image is to be a document production workhorse. Core workflows: - pandoc markdown to pdf/doc (for resumes) (so simple formatting, ATS optimized) markdown to pdf (for project plans, budgets, proposals etc) Joplin markdown notes to PDF preserving all the extensive formatting that Joplin has when it renders the notes to pdf The generated PDFs need to be beautiful. Rich fonts, graphics, formatting of the code listings etc. We will be heavily leaning into texlive/xetex for this. I would also like to explore using wkhtmltopdf so that CSS can be used to style the output. - mdbook - typst - marp - markwhen - kroki cli - quarto - bibtool - vale Add in any other common support tools you think may be needed (such as jq/yq). Generally this image will be used "headless" to run a generation workflow (or mdbook serve during active development of an mdbook site). It should have fish as it's shell (and also bash/zsh) for the occasional interactive use. Follow test-driven-development for this project without fail. Ensure that the image is built successfully and fully validated against this PRD Use the /home/localuser/TSYSDevStack/Toolbox/docs/output directory for all of the work you do for this task.
This commit is contained in:
161
documentation/TROUBLESHOOTING.md
Normal file
161
documentation/TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# TROUBLESHOOTING.md
|
||||
|
||||
## TSYSDevStack - Toolboxes - DocsAndDiagrams
|
||||
|
||||
Troubleshooting Guide for the Document Production Workhorse Container
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Common Issues and Solutions
|
||||
|
||||
### Docker Container Won't Start
|
||||
|
||||
**Issue**: Container fails to start with permission errors
|
||||
|
||||
**Solution**:
|
||||
```bash
|
||||
# Check if Docker daemon is running
|
||||
sudo systemctl status docker
|
||||
|
||||
# If not running, start it
|
||||
sudo systemctl start docker
|
||||
|
||||
# Ensure your user is in the docker group
|
||||
sudo usermod -aG docker $USER
|
||||
# Then log out and log back in
|
||||
```
|
||||
|
||||
### Permission Denied Errors
|
||||
|
||||
**Issue**: Getting permission errors when accessing mounted volumes
|
||||
|
||||
**Solution**:
|
||||
1. The container runs as user `tsysdevstack` with UID 1000
|
||||
2. Ensure your host directory is writable by UID 1000:
|
||||
```bash
|
||||
sudo chown -R 1000:1000 /path/to/local/directory
|
||||
```
|
||||
3. Or run the container with appropriate user mapping:
|
||||
```bash
|
||||
docker run -u $(id -u):$(id -g) -v $(pwd)/output:/home/tsysdevstack/TSYSDevStack/Toolbox/docs/output tsysdevstack/toolboxes-docs
|
||||
```
|
||||
|
||||
### Pandoc Fails with Font Errors
|
||||
|
||||
**Issue**: PDF generation fails with font-related errors
|
||||
|
||||
**Solution**:
|
||||
1. The container includes Noto fonts, but you may need additional fonts:
|
||||
```bash
|
||||
# Check available fonts
|
||||
fc-list
|
||||
|
||||
# Install additional fonts by extending the container
|
||||
```
|
||||
|
||||
### Large Document Processing Issues
|
||||
|
||||
**Issue**: Container runs out of memory when processing large documents
|
||||
|
||||
**Solution**:
|
||||
1. Increase Docker's memory allocation in Docker Desktop settings
|
||||
2. Run with memory limits:
|
||||
```bash
|
||||
docker run --memory="4g" -v $(pwd)/output:/home/tsysdevstack/TSYSDevStack/Toolbox/docs/output tsysdevstack/toolboxes-docs
|
||||
```
|
||||
|
||||
### TeXLive Compilation Fails
|
||||
|
||||
**Issue**: LaTeX compilation fails with missing packages
|
||||
|
||||
**Solution**:
|
||||
1. The container includes a basic TeXLive installation with common packages
|
||||
2. For additional packages, use `tlmgr`:
|
||||
```bash
|
||||
docker run -it tsysdevstack/toolboxes-docs tlmgr install package-name
|
||||
```
|
||||
|
||||
### Missing Language Runtime Tools
|
||||
|
||||
**Issue**: Tools installed via npm/pip not working
|
||||
|
||||
**Solution**:
|
||||
1. The container uses `mise` to manage language runtimes
|
||||
2. Check if the runtime is properly configured:
|
||||
```bash
|
||||
mise current
|
||||
```
|
||||
3. Install or activate the required version:
|
||||
```bash
|
||||
mise use --global python@3.12.6 # or required version
|
||||
```
|
||||
|
||||
### Quarto Rendering Issues
|
||||
|
||||
**Issue**: Quarto fails with missing R or Python environments
|
||||
|
||||
**Solution**:
|
||||
1. The container has a basic Python environment but may need extensions:
|
||||
```bash
|
||||
# Install required Python packages
|
||||
pip3 install jupyter numpy pandas matplotlib
|
||||
```
|
||||
|
||||
## 🔧 Diagnostic Commands
|
||||
|
||||
### Check Container Information
|
||||
```bash
|
||||
# Check running containers
|
||||
docker ps
|
||||
|
||||
# Check container logs
|
||||
docker logs <container-name>
|
||||
|
||||
# Execute commands in running container
|
||||
docker exec -it <container-name> /bin/bash
|
||||
```
|
||||
|
||||
### Verify Tool Availability
|
||||
```bash
|
||||
# Check all installed tools
|
||||
docker run --rm tsysdevstack/toolboxes-docs which pandoc mdbook typst marp quarto jq yq
|
||||
|
||||
# Check Pandoc version and capabilities
|
||||
docker run --rm tsysdevstack/toolboxes-docs pandoc --version
|
||||
|
||||
# Check TeXLive installation
|
||||
docker run --rm tsysdevstack/toolboxes-docs xelatex --version
|
||||
```
|
||||
|
||||
### Check Storage and Paths
|
||||
```bash
|
||||
# Verify output directory exists and is writable
|
||||
docker run --rm -v $(pwd)/output:/home/tsysdevstack/TSYSDevStack/Toolbox/docs/output tsysdevstack/toolboxes-docs ls -la /home/tsysdevstack/TSYSDevStack/Toolbox/docs/output
|
||||
|
||||
# Check if input files are accessible
|
||||
docker run --rm -v $(pwd)/:/data tsysdevstack/toolboxes-docs ls -la /data
|
||||
```
|
||||
|
||||
## 🔍 Debugging Steps
|
||||
|
||||
1. **Check the error message carefully**
|
||||
2. **Verify your input files exist and are accessible**
|
||||
3. **Check that you have sufficient disk space**
|
||||
4. **Try running a simple command first** (e.g., `pandoc --version`)
|
||||
5. **Check container logs** if running as a service
|
||||
6. **Verify volume mappings are correct**
|
||||
7. **Test with a minimal document** to isolate issues
|
||||
|
||||
## 📞 Support
|
||||
|
||||
If you encounter issues not covered in this guide:
|
||||
|
||||
1. Check the [Usage Guide](USAGE.md) for correct command syntax
|
||||
2. Review [Cheat Sheet](CHEATSHEET.md) for common commands
|
||||
3. Search the repository issues for similar problems
|
||||
4. Create a new issue with:
|
||||
- Docker version
|
||||
- Host OS
|
||||
- Command used
|
||||
- Error message
|
||||
- Expected behavior
|
||||
Reference in New Issue
Block a user