Skip to content

Instantly share code, notes, and snippets.

View KentFujii's full-sized avatar

Kent Fujii KentFujii

View GitHub Profile
@KentFujii
KentFujii / myruby.dig
Last active December 12, 2022 06:30
Dag for debugging digdag ruby operator
_export:
rb:
require: myruby
+step1:
rb>: Task::MyWorkflow.step1
@KentFujii
KentFujii / my_workflow_1.dig
Last active December 12, 2021 06:52
Digdag Ruby workflow
_export:
rb:
require: tasks/my_workflow_1
+step1:
rb>: Task::MyWorkflow.step1
+step2:
rb>: Task::MyWorkflow.step2
@KentFujii
KentFujii / Dockerfile
Last active November 23, 2021 06:39
PyTest examples
FROM debian:stretch
ENV LANG C.UTF-8
ENV TZ Asia/Tokyo
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONPATH /example
ADD . /example
WORKDIR /example
#python
@KentFujii
KentFujii / push.sh
Last active June 16, 2021 08:05
Digdag REST API with curl
# digdag push
tar -czvf myproject.tar.gz myproject.dig myruby.dig myruby.rb
REVISION=sample
curl -X PUT -H "Content-Type: application/gzip" --data-binary @myproject.tar.gz "http://localhost:65432/api/projects?project=myproject&revision=$REVISION" | jq .
rm myproject.tar.gz
@KentFujii
KentFujii / mypython.dig
Last active June 16, 2021 08:06
Digdag with Python
_export:
py:
require: workflow_lib.workflow_lib.Workflow
arg1: arg1!!!
arg2: ${gcs.project}
arg3: ${session_date}
+task:
py>: workflow_lib.workflow_lib.Workflow.task
task_arg: task_arg!!!!!
@KentFujii
KentFujii / myruby.dig
Last active February 21, 2021 08:11
Digdag with Ruby
_export:
rb:
require: 'myruby'
sample: sample!!!
foo: 1
bar:
+step1:
rb>: MyWorkflow.step1
@KentFujii
KentFujii / auth.txt
Created October 20, 2020 15:18
digdag with basic auth
user_name:encrypted_password
@KentFujii
KentFujii / AnsibleDockerfile
Last active May 6, 2021 13:33
run docker-compose from inside containerized ansible
FROM python:3.6.6-stretch
# Setup
ENV LANG C.UTF-8
ENV EDITOR vim
ADD . /var/www/muramasa
WORKDIR /var/www/muramasa/ansible
RUN apt-get update && apt-get install -y curl git vim
# Install gcloud
@KentFujii
KentFujii / kubernetes.sh
Last active August 10, 2020 12:12
run kubectl commands from inside docker container
## command from host
kubectl create deployment nginx --image=nginx
## command from pod
apt-get update && apt-get install -y curl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
kubectl get pod
@KentFujii
KentFujii / docker.sh
Last active April 10, 2021 15:39
connect to docker daemon from docker container
## command from host
docker run -v /var/run/docker.sock:/var/run/docker.sock -it debian
## command from container
apt-get update && apt-get install -y curl
export DOCKER_CLIENT_VERSION=1.12.6
curl -fsSL https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_CLIENT_VERSION}.tgz | tar -xzC /usr/local/bin --strip=1 docker/docker
docker run debian sleep 10