Skip to content

Commit

Permalink
updated devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmordasiewicz committed Mar 19, 2024
1 parent 74e30f3 commit 13654f5
Show file tree
Hide file tree
Showing 8 changed files with 410 additions and 52 deletions.
11 changes: 0 additions & 11 deletions .devcontainer/.vimrc

This file was deleted.

33 changes: 24 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
"ms-azuretools.vscode-docker",
"MS-CST-E.vscode-devskim",
"ms-python.python",
"ms-ossdata.vscode-postgresql",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-powertoys",
"ms-vscode.azure-account",
"ms-azuretools.vscode-azureterraform"
"ms-azuretools.vscode-azureterraform",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"visualstudioexptteam.vscodeintellicode"
],
"settings": {
"terminal.integrated.profiles.linux": {
Expand Down Expand Up @@ -61,43 +67,52 @@
"software-properties-common",
"iputils-ping",
"cmake",
"libpoppler-cpp-dev",
"libsecret-1-dev",
"yelp-tools",
"libyelp-dev",
"libgif-dev",
"autoconf",
"tesseract-ocr",
"ubuntu-drivers-common",
"nodejs"
]
},
"ghcr.io/devcontainers-contrib/features/black:2": {},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/devcontainers-cli:1": {},
"ghcr.io/devcontainers-contrib/features/ffmpeg-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/fzf:1": {},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {},
"ghcr.io/devcontainers-contrib/features/mkdocs:2": {},
"ghcr.io/devcontainers-contrib/features/poppler-utils-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/pylint:2": {},
"ghcr.io/devcontainers-contrib/features/qrcode:2": {},
"ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/vscode-cli:1": {},
"ghcr.io/devcontainers-contrib/features/vscode-server:1": {},
"ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/yamllint:2": {},
"ghcr.io/devcontainers-contrib/features/yt-dlp:2": {},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-eza",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/z-shell/zsh-eza.git"
"plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-aliases-lsd zsh-tfenv conda-zsh-completion",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/conda-incubator/conda-zsh-completion.git https://github.com/z-shell/zsh-eza.git https://github.com/cda0/zsh-tfenv.git https://github.com/yuhonas/zsh-aliases-lsd.git"
},
"ghcr.io/devcontainers-community/npm-features/prettier:1": {},
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/hwaien/devcontainer-features/match-host-time-zone": {},
"ghcr.io/joshuanianji/devcontainer-features/github-cli-persistence:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/gitleaks:1": {},
"ghcr.io/jungaretti/features/make:1": {},
"ghcr.io/lukewiwa/features/shellcheck:0": {},
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {},
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {},
"ghcr.io/schlich/devcontainer-features/powerlevel10k:1": {},
"ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}
"ghcr.io/rocker-org/devcontainer-features/miniforge:1": {},
"ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {},
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
},
"postStartCommand": "",
"postCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} ; ./.devcontainer/postCreateCommand.sh",
"appPort": [],
"postStartCommand": "./.devcontainer/postStartCommand.sh",
"postCreateCommand": "sudo chown -R vscode:vscode ${containerWorkspaceFolder} ; git config --global --add safe.directory ${containerWorkspaceFolder} && ./.devcontainer/postCreateCommand.sh",
"appPort": ["8081:8081"],
"containerEnv": {},
"runArgs": ["--name", "devops-toolkit"],
"mounts": []
Expand Down
109 changes: 109 additions & 0 deletions .devcontainer/devcontainer.json.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"name": "devcontainer",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu22.04",
"customizations": {
"vscode": {
"extensions": [
"Continue.continue",
"duniul.dircolors",
"esbenp.prettier-vscode",
"HashiCorp.terraform",
"MarkLarah.pre-commit-vscode",
"ms-azuretools.vscode-docker",
"MS-CST-E.vscode-devskim",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.azure-account",
"ms-azuretools.vscode-azureterraform",
"alphaxek.github-actions-locally",
"amazonwebservices.aws-toolkit-vscode",
"github.vscode-github-actions",
"OmarTawfik.github-actions-vscode"
],
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
},
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "3.11"
},
"ghcr.io/devcontainers/features/terraform:1": {
"installTFsec": true,
"installTerraformDocs": true
},
"ghcr.io/devcontainers-contrib/features/act:1": {},
"ghcr.io/devcontainers-contrib/features/actionlint:1": {},
"ghcr.io/devcontainers-contrib/features/ansible:2": {},
"ghcr.io/devcontainers-contrib/features/apt-packages:1": {
"packages": [
"software-properties-common",
"iputils-ping",
"cmake",
"libsecret-1-dev",
"yelp-tools",
"libyelp-dev",
"libgif-dev",
"autoconf",
"nodejs"
]
},
"ghcr.io/devcontainers-contrib/features/black:2": {},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/fzf:1": {},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli2:1": {},
"ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/vscode-cli:1": {},
"ghcr.io/devcontainers-contrib/features/vscode-server:1": {},
"ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/yamllint:2": {},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"plugins": "zsh-syntax-highlighting zsh-autosuggestions ubuntu jsontools gh common-aliases zsh-tfenv conda-zsh-completion",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git https://github.com/cda0/zsh-tfenv.git https://github.com/conda-incubator/conda-zsh-completion.git"
},
"ghcr.io/devcontainers-community/npm-features/prettier:1": {},
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/hwaien/devcontainer-features/match-host-time-zone": {},
"ghcr.io/joshuanianji/devcontainer-features/github-cli-persistence:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/gitleaks:1": {},
"ghcr.io/jungaretti/features/make:1": {},
"ghcr.io/lukewiwa/features/shellcheck:0": {},
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {},
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {},
"ghcr.io/rocker-org/devcontainer-features/miniforge:1": {},
"ghcr.io/stuartleeks/dev-container-features/azure-cli-persistence:0": {}
},
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/postStartCommand.sh",
"postCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} ; ${containerWorkspaceFolder}/.devcontainer/postCreateCommand.sh",
"appPort": [],
"containerEnv": {
"PRE_COMMIT_ALLOW_NO_CONFIG": "1"
},
"runArgs": ["--name", "devcontainer"],
"mounts": []
}
135 changes: 135 additions & 0 deletions .devcontainer/mkdocs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
site_name: GITHUBREPOSITORYNAME
site_description: >-
GITHUBREPOSITORYDESCRIPTION
site_url: GITHUBPAGESURL
site_author: FIRSTNAMELASTNAME
docs_dir: docs
site_dir: site

repo_name: GITHUBUSERNAME/GITHUBREPOSITORYNAME
repo_url: GITHUBREPOSITORYCANONICALURL
edit_uri: edit/main/docs/

# yamllint disable-line rule:line-length
copyright: "Try to be nice."

extra:
annotate:
json: [.s2]
generator: false
social:
- icon: custom/fc-lib-facebook
link: https://www.facebook.com/robin.mordasiewicz/
- icon: custom/fc-lib-twitter
link: https://twitter.com/r_mordasiewicz
- icon: custom/fc-lib-youtube
link: https://www.youtube.com/channel/UCc2rQTQp22P2WEhCArzlUoQ
- icon: custom/fc-lib-linkedin
link: https://www.linkedin.com/in/robin-mordasiewicz

validation:
omitted_files: warn
absolute_links: warn
unrecognized_links: warn

extra_css: [extra.css]

theme:
name: material
custom_dir: docs/overrides
include_sidebar: false
logo: logo.svg
favicon: favicon.ico
icon:
repo: fontawesome/brands/github
features:
- announce.dismiss
- content.action.view
- content.code.annotate
- content.code.copy
# - content.tabs.link
- content.tooltips
- header.autohide
- navigation.footer
# - navigation.indexes
- navigation.instant
- navigation.instant.prefetch
- navigation.instant.progress
# - navigation.prune
# - navigation.sections
- navigation.tabs
- navigation.top
- navigation.tracking
- navigation.path
- search.highlight
- search.share
- search.suggest
- toc.follow
palette:
- media: "(prefers-color-scheme: light)"
primary: black
accent: grey
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
primary: grey
accent: black
scheme: slate
toggle:
icon: material/toggle-switch
font:
text: Roboto
code: Roboto Mono

markdown_extensions:
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
options:
custom_icons:
- overrides/.icons
- abbr
- admonition
- attr_list
- def_list
- footnotes
- md_in_html
- toc:
toc_depth: "1-1"
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.tilde
- pymdownx.keys
- pymdownx.magiclink:
normalize_issue_symbols: true
repo_url_shorthand: true
user: GITHUBUSERNAME
repo: GITHUBREPOSITORYNAME
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tabbed:
alternate_style: true
combine_header_slug: true
slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds:

plugins:
- glightbox
- search:
separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
# - blog:
# blog_dir: concepts
# post_dir: "{blog}/articles"
# post_readtime: false
# archive: false
# authors: false
26 changes: 26 additions & 0 deletions .devcontainer/opencommit-ollama.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/out/cli.cjs b/out/cli.cjs
index 52581c3..f91cdc9 100755
--- a/out/cli.cjs
+++ b/out/cli.cjs
@@ -22006,7 +22006,7 @@ var api = new OpenAi();
var OllamaAi = class {
async generateCommitMessage(messages) {
const model = "mistral";
- const url3 = "http://localhost:11434/api/chat";
+ const url3 = "http://192.168.2.28:11434/api/chat";
const p4 = {
model,
messages,
diff --git a/src/engine/ollama.ts b/src/engine/ollama.ts
index f431ee1..517f0c3 100644
--- a/src/engine/ollama.ts
+++ b/src/engine/ollama.ts
@@ -11,7 +11,7 @@ export class OllamaAi implements AiEngine {
//console.log(messages);
//process.exit()

- const url = 'http://localhost:11434/api/chat';
+ const url = 'http://192.168.2.28:11434/api/chat';
const p = {
model,
messages,
21 changes: 21 additions & 0 deletions .devcontainer/opencommit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#

REPODIR=$(pwd)

echo "Enter the Host IP address:"
read -r HOSTIPADDRESS

if sed -i "s/HOSTIPADDRESS/${HOSTIPADDRESS}/g" "${REPODIR}"/.devcontainer/opencommit-ollama.patch; then
if [ -d /tmp/opencommit ]; then
rm -rf /tmp/opencommit
fi
git clone https://github.com/di-sukharev/opencommit.git /tmp/opencommit
cd /tmp/opencommit || return
git apply "${REPODIR}"/.devcontainer/opencommit-ollama.patch
sudo -H env PATH="${PATH}" npm uninstall -g
sudo -H env PATH="${PATH}" npm install -g
echo "OCO_AI_PROVIDER=ollama" >~/.opencommit
cd "${REPODIR}" || return
oco hook set
fi
Loading

0 comments on commit 13654f5

Please sign in to comment.