Skip to content

Commit

Permalink
Merge pull request #8 from boromir674/release
Browse files Browse the repository at this point in the history
[NEW] Neural Style Transfer v1.0.0
  • Loading branch information
boromir674 committed Oct 29, 2023
2 parents c3d045a + 6eadf32 commit 3525aea
Show file tree
Hide file tree
Showing 72 changed files with 6,358 additions and 1,055 deletions.
3 changes: 0 additions & 3 deletions .bettercodehub.yml

This file was deleted.

1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[run]
source =
artificial_artwork
tests

[report]
show_missing = true
Expand Down
97 changes: 97 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT="3.10"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# Python Configuration
ENV PYTHONUNBUFFERED 1

# Generic/Other Tools Provision/Configuration
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# Options
ARG INSTALL_ZSH="true"
ARG UPGRADE_PACKAGES="false"
ARG USE_MOBY="true"
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
COPY .devcontainer/library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
&& apt-get -y install --no-install-recommends iproute2 \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& /bin/bash /tmp/library-scripts/docker-debian.sh "true" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}" "${USE_MOBY}" \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts/
# && /bin/bash /tmp/library-scripts/kubectl-helm-debian.sh "latest" "latest" "none" \

# Application/Dev Environment Configuration
# Install HDF5 C++ Runtime files
RUN apt-get update \
&& apt-get -y install --no-install-recommends libhdf5-dev \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Install prerequisites to building the scipy package
# for building the scipy package we use the pip install, which for scipy==1.4
# uses the legacy build backend of setuptools
RUN apt-get update \
&& apt-get -y install --no-install-recommends gcc \
build-essential \
zlib1g-dev \
wget \
unzip \
cmake \
python3-dev \
gfortran \
libblas-dev \
liblapack-dev \
libatlas-base-dev \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*


# Install Cloud CLI's here, if needed

WORKDIR /config

# Setting the ENTRYPOINT to docker-init.sh will configure non-root access to
# the Docker socket if "overrideCommand": false is set in devcontainer.json.
# The script will also execute CMD if you need to alter startup behaviors.
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]

# Essential/Usefull Tools
# Install poetry and tox, which are essential Tools for any Python dev stack
# && git clone git@github.com:boromir674/tree-1.8.0.git \
RUN pip3 --disable-pip-version-check install tox==3.27.1 poetry \
&& rm -rf /tmp/pip-tmp

# Install tree cli tool
RUN git clone https://github.com/boromir674/tree-1.8.0.git tree-repo
WORKDIR /config/tree-repo

RUN rm *.o && make tree && make install

WORKDIR /config

RUN rm -rf tree-repo
# && rm -rf tree-1.8.0 \
# && apt-get update \
# && apt-get -y install --no-install-recommends tree \
# && apt-get autoremove -y \
# && apt-get clean -y \
# && rm -rf /var/lib/apt/lists/*



# allow code navigation inside vscode, by installing the prod + test dependencies
COPY poetry.lock /tmp/pip-tmp/
COPY pyproject.toml /tmp/pip-tmp/
RUN poetry export --directory=/tmp/pip-tmp/ -f requirements.txt -o /tmp/pip-tmp/requirements-test.txt -E test \
&& pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements-test.txt \
&& rm -rf /tmp/pip-tmp
85 changes: 85 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Update the VARIANT arg in docker-compose.yml to pick a Python version
{
"name": "Neural Style Transfer",

//Dedicated to Docker-compose
//----------------------
"dockerComposeFile": [
"docker-compose-dev-container.yml",
"docker-compose-tensorboard.yml"
],

// set the service to connect to, out of all the "composed" services
// this will be the environment (in the dev-container) that the developer will be operain
// for example the developer will be able to spawn one or more shells, in the environment
"service": "my_dev_container",
//----------------------

// Dedicated to docker-file/kubernetes
//----------------------
// "build" : {
// "dockerfile": "Dockerfile",
// "context" : ".."
// },
// "overrideCommand": false,
// "remoteEnv": {
// "SYNC_LOCALHOST_KUBECONFIG": "true"
// },
// "runArgs": ["--cap-add=NET_ADMIN", "--cap-add=NET_BIND_SERVICE"],
//----------------------

"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
// "source=${env:HOME}${env:USERPROFILE}/.kube,target=/usr/local/share/kube-localhost,type=bind"
// Uncomment the next line to also sync certs in your .minikube folder
// "source=${env:HOME}${env:USERPROFILE}/.minikube,target=/usr/local/share/minikube-localhost,type=bind"
],

"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// "remoteUser": "vscode",

// postCreateCommand -> postStartCommand

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip install --user -r requirements.txt",

//"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && poetry install -E test",
// to enable git commands
"postStartCommand": {
// "yarn_install": "yarn install --frozen-lockfile --prodution=false --non-interactive",
// "yarn_develop": "yarn develop"
// "git_add_safe": "git config --global --add safe.directory ${containerWorkspaceFolder}",
},
// Features to add to the dev container. More info: https://containers.dev/implementors/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or the host.
"forwardPorts": [8000],
// server x is on 8000

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

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
// "ms-azuretools.vscode-docker",
// "ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-python.python"
// "ms-python.vscode-pylance",
// "patbenatar.advanced-new-file",
// "aaron-bond.better-comments",
// "ms-python.autopep8",
// "mtxr.sqltools",
// "mtxr.sqltools-driver-pg"
]
}
}
}
32 changes: 32 additions & 0 deletions .devcontainer/docker-compose-dev-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3.8'

services:
my_dev_container:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
# build arguments passed at build time
args: # build arguments (passed on docker build)
# Python version to use (ie 3.10, 3.8)
# python 3.8 is the first runtime that the app is developed to run on
VARIANT: "3.8"

# hard-coded env variables to inject in the built image/container at runtime
environment:
AA_VGG_19: pretrained_model_bundle/imagenet-vgg-verydeep-19.mat
# MY_ENV_VAR: 1

volumes:
- ../..:/workspaces:cached

# open a dev server with hot-reload in the default shell
# command: yarn develop

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity # should result in an open shell

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
19 changes: 19 additions & 0 deletions .devcontainer/docker-compose-tensorboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3.7'

services:
tensorboard_dev:
# How to BUILD the tensorboard_dev image
build:
context: .. # Path to the directory containing your Dockerfile
dockerfile: Dockerfile.tensorboard

# --build-args passed on docker build
args:
- TENSORBOARD_PORT=6006 # Change this value to set the TensorBoard port

# How to RUN the tensorboard_dev image
ports:
- "${TENSORBOARD_PORT:-6006}:6006"
volumes:
- ../logs-tensorboard:/runs # Mount your log directory
command: ["tensorboard", "--logdir=runs", "--port=6006", "--bind_all"]
5 changes: 5 additions & 0 deletions .devcontainer/library-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Warning: Folder contents may be replaced

The contents of this folder will be automatically replaced with a file of the same name in the repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/main/script-library) whenever the repository is packaged.

To retain your edits, move the file to a different location. You may also delete the files if they are not needed.

0 comments on commit 3525aea

Please sign in to comment.