Skip to content

Commit

Permalink
#12 add dockerfile, devcon.json, readme & makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
julien legrand committed Nov 6, 2023
1 parent 11e3416 commit 71378e5
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
34 changes: 34 additions & 0 deletions custom_nodes/python/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile.devCont"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.makefile-tools",
"ms-python.python"
]
}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
24 changes: 24 additions & 0 deletions custom_nodes/python/.devcontainer/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Py-punch Dev Container

## Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)

## Introduction
This repository contains the configuration for a development container that is pre-configured with the necessary tools and dependencies for working on the Py-punch project. Using a development container helps maintain a consistent and reproducible development environment for contributors.

## Prerequisites
Before you begin, ensure you have met the following requirements:
- [Docker](https://www.docker.com/get-started) installed on your system.
- [Visual Studio Code](https://code.visualstudio.com/) with the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.

## Getting Started
To get started with the development container, follow these steps:

1. Once the extension is present, simply do "CTRL+shift+p".
2. Enter "Dev Containers: Reopen in Container".
3. Develop your specific nodes.
4. Create your punchline that allows you to test the previously written code.
5. Use command make run-dev

9 changes: 9 additions & 0 deletions custom_nodes/python/Dockerfile.devCont
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build
FROM ghcr.io/punchplatform/punchline-python:8.1-dev
USER root
RUN apt-get update && apt-get install -y --no-install-recommends make && apt-get -y install sudo && apt-get -y install git && apt-get -y install gettext-base && apt-get -y install zip
#RUN useradd --create-home punch
ARG VERSION
ARG POETRY_USERNAME
ARG POETRY_PASSWORD

11 changes: 10 additions & 1 deletion custom_nodes/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,21 @@ clean: ## Clean this repository

.PHONY: run

run: ## Test your artifact with java engine using docker
run: ## Test your artifact with python engine using docker
docker run --rm -it \
-v $(OUTPUT_FILE):/usr/share/punch/$(DEPENDENCY_LOCATION) \
-v $(CURDIR)/test/punchline.yaml:/data/punchline.yaml \
$(PUNCHLINE_IMG) /data/punchline.yaml


.PHONY: run-dev

run-dev: build ## Test your artifact with python engine using docker
mkdir -p /usr/share/punch/extlib/
cp $(OUTPUT_FILE) /usr/share/punch/$(DEPENDENCY_LOCATION)
cp $(CURDIR)/test/punchline.yaml /data/punchline.yaml
bash /start.sh /workspaces/starters/custom_nodes/python/test/punchline.yaml

.PHONY: upload

upload: ## Upload artifact to artifact server
Expand Down

0 comments on commit 71378e5

Please sign in to comment.