Skip to content

Instantly share code, notes, and snippets.

View atemate's full-sized avatar
🐒

Artem Yushkovskiy atemate

🐒
View GitHub Profile
@atemate
atemate / lanalan_error_codes.json
Last active December 8, 2015 20:31
lanalan_refactoredюзн
{
"00": "Everything OK - Success",
"01": "Couldn’t poll Parent because of Timeout",
"02": "Unknown command",
"04": "Invalid S-Register",
"05": "Invalid parameter",
"06": "Recipient could not be reached",
"07": "Message was not acknowledged",
"08": "No sink known",
"09": "Address Table entry is in use and cannot be modified",
@atemate
atemate / test_thread.py
Created December 8, 2015 22:29
threads_testing
from threading import Thread
from time import sleep
class Test:
def __init__(self):
self.my_thread = Thread(target=self.do_loop, name='infinite_loop')
self.my_thread.start()
exit()
# Image with gsutil:
`image://artemyushkovskiy/neuromation/base-gsutil:latest`
# Run a job, mount storage's volume to `/home`:
`neuro run -s cpu-small -n soro -v storage:ru_open_stt_wav:/home:rw neuromation/base "sleep infinity"`
# Download data to storage:
`gsutil cp -r gs://ru_open_stt_wav /home`
# Extract tar.gz's
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@atemate
atemate / Dockerfile
Last active May 20, 2020 14:00
Proposal: Flexible Neuro Base Image
ARG base_image
FROM ${base_image:-"neuromation/base:latest"}
# 1. Some Neuro Platform-common setup
# ===================================
# Force the stdout and stderr streams to be unbuffered.
# Needed for correct work of tqdm via 'neuro exec'
version: 0.1 # version of this yaml format
## We'd store project's setup in hierarchical constants
environment:
project: # all first-order elements except those like $(.name) simply define constants
version: v2.0 # for example, this constant can be accessed with $(project.version)
id: neuro-21dd4a2
name: my-project
paths:
@pytest.fixture(scope="session")
async def kube_proxy_url(docker_host: str) -> str:
cmd = "kubectl proxy -p 8084 --address='0.0.0.0' --accept-hosts='.*'"
err = f"Error while running command `{cmd}`"
proc = subprocess.Popen(
cmd,
shell=True,
stderr=subprocess.STDOUT,
stdout=subprocess.PIPE,
@atemate
atemate / .neuro__user.toml
Last active August 24, 2020 10:14
Git-like upload and download shortcuts for neuro
[storage]
cp-exclude = [".git"]
cp-exclude-from-files = [".neuroignore", ".gitignore"]
# helpers
[alias.proj-name]
exec = "sh -c 'basename `neuro proj-local`'"
@atemate
atemate / Dockerfile
Created October 8, 2020 10:23
Image build problem on onprem-poc (unsupported status code 504)
FROM neuromation/base:v1.6 # take not the ":latest" base image
WORKDIR /project
COPY apt.txt .
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -qq update && \
cat apt.txt | tr -d "\r" | xargs -I % apt-get -qq install --no-install-recommends % && \
apt-get -qq clean && \
apt-get autoremove && \
{"images":[{"id":110082,"coco_url":"https://outforz.s3.amazonaws.com/media/public/content/2020/10/08/96e19efb-f49.jpg","width":1920,"height":2560,"file_name":"content/2020/10/08/96e19efb-f49.jpg","date_captured":"2020-10-08T00:20:40.743240Z"},{"id":110083,"coco_url":"https://outforz.s3.amazonaws.com/media/public/content/2020/10/08/d5ce3907-3de.jpg","width":1920,"height":2560,"file_name":"content/2020/10/08/d5ce3907-3de.jpg","date_captured":"2020-10-08T00:20:43.431366Z"},{"id":110084,"coco_url":"https://outforz.s3.amazonaws.com/media/public/content/2020/10/08/4022986c-47f.jpg","width":1920,"height":2560,"file_name":"content/2020/10/08/4022986c-47f.jpg","date_captured":"2020-10-08T00:20:45.916614Z"},{"id":110086,"coco_url":"https://outforz.s3.amazonaws.com/media/public/content/2020/10/08/db70cb06-9b0.jpg","width":1920,"height":2560,"file_name":"content/2020/10/08/db70cb06-9b0.jpg","date_captured":"2020-10-08T00:20:51.830341Z"},{"id":110087,"coco_url":"https://outforz.s3.amazonaws.com/media/public/content/2020/1