Skip to content

Instantly share code, notes, and snippets.

View jameswnl's full-sized avatar

James Wong jameswnl

View GitHub Profile
@jameswnl
jameswnl / llamastack-build.yaml
Created February 28, 2025 01:52
As of llama-stack 0.1.2. Using template ollama
version: '2'
distribution_spec:
description: Use (an external) Ollama server for running LLM inference
container_image: null
providers:
inference:
- remote::ollama
vector_io:
- inline::faiss
- remote::chromadb
version: '2'
image_name: ollama-conda
container_image: null
apis:
- inference
- safety
- agents
- vector_io
- datasetio
- scoring
#!/bin/sh
set -o errexit
set -o pipefail
######### postgres_ready #########
postgres_ready() {
python << END
import logging
import os
@jameswnl
jameswnl / port-forward.sh
Created July 10, 2020 20:58
script to port forwarding to the test-data-generator pod
#!/bin/sh
oc project tower-analytics-$1. # expect either ci or qa
if [ $? -eq 1 ]; then
echo "oc project tower-analytics-$0 failed. Abort"
exit 1
fi
for i in $(oc get pods -o name);
do
echo $i
vagrant@minikf:~/kfv1$ kfctl generate all -V
INFO[0000] Ksonnet.Generate Name AppDir Platform filename="ksonnet/ksonnet.go:369"
INFO[0000] Creating environment "default" with namespace "default", pointing to "version:v1.13.2" cluster at address "https://10.10.10.10:8443" filename="env/create.go:77"
INFO[0003] Generating ksonnet-lib data at path 'ks_app/lib/ksonnet-lib/v1.13.2' filename="lib/lib.go:148"
INFO[0003] Successfully initialized the app . filename="ksonnet/ksonnet.go:505"
INFO[0003] App add registry kubeflow URI filename="ksonnet/ksonnet.go:621"
Error: couldn't generate KfApp: (kubeflow.error): Code 500 with message: kfApp Generate failed for ksonnet: (kubeflow.error): Code 400 with message: couldn't add registry kubeflow. Error: there was a problem adding registry kubeflow: initializing helm HTTP client: normalizing Helm repository URL: "" is an invalid scheme for Helm repository
Usage:
kfctl generate [all(=default)|k8s|platform] [flags]
@jameswnl
jameswnl / conversion_host_spec.rb
Last active February 8, 2019 21:16
spec stub method
require "MiqSshUtil"
describe ConversionHost do
let(:apst) { FactoryBot.create(:service_template_ansible_playbook) }
let(:host) { FactoryBot.create(:host) }
let(:vm) { FactoryBot.create(:vm_or_template) }
before do
allow(vm).to receive(:supports_conversion_host?).and_return(true)
allow(host).to receive(:supports_conversion_host?).and_return(true)
sudo xcode-select -s /Library/Developer/CommandLineTools && gem install ovirt-engine-sdk -v4.1.9 && sudo xcode-select -r
@jameswnl
jameswnl / vmware_metric_counters.rb
Created October 17, 2017 15:14
VMware metric counters
counter_keys = ["net_usage_rate_average",
"mem_vmmemctl_absolute_average",
"net_usage_rate_average",
"cpu_ready_delta_summation",
"mem_swaptarget_absolute_average",
"net_usage_rate_average",
"net_usage_rate_average",
"cpu_ready_delta_summation",
"mem_vmmemctltarget_absolute_average",
"net_usage_rate_average",
@jameswnl
jameswnl / NewMiqProvider.md
Last active November 15, 2017 20:10
Describe pain points with possible enhancements of creating a new MIQ Provider

Based on using existing generator commnd: rails generate provider <AnyCloud>

Difficulties/Problems

  1. Variable not found error for the new cloud manager due to naming convention of class and folder.
  2. UI add-provider page: Validate button not enabled
  3. manageiq-ui-classic/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml
  4. manageiq-ui-classic/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml
@jameswnl
jameswnl / SecondMiqAppliance
Created October 3, 2017 18:19
Set up 2nd MIQ appliance
systemctl stop evmserverd && systemctl disable evmserverd
systemctl stop $APPLIANCE_PG_SERVICE && systemctl disable $APPLIANCE_PG_SERVICE
rm -rf $APPLIANCE_PG_DATA/*
vmdb && rm -f REGION config/database.yml