Skip to content

Commit 3e3564f

Browse files
authored
Initial commit
0 parents  commit 3e3564f

File tree

17 files changed

+2283
-0
lines changed

17 files changed

+2283
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.11-bookworm
2+
3+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get -y install --no-install-recommends \
5+
openjdk-17-jre \
6+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
7+
8+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
9+
10+
11+
# Set the working directory
12+
WORKDIR /workspace
13+
14+
# Copy the scripts folder into the container
15+
COPY scripts /workspace/scripts
16+
17+
COPY requirements.txt /workspace/requirements.txt
18+
19+
20+
RUN pip install --no-cache-dir --upgrade pip \
21+
&& pip install --no-cache-dir -r /workspace/requirements.txt
22+
23+
# Ensure the scripts have execution permissions
24+
RUN chmod +x /workspace/scripts/init-env.sh
25+
26+
# # Ensure the virtual environment is created
27+
# RUN python -m venv /workspace/.venv
28+
29+
# # Ensure the activate script runs for bash shells
30+
# RUN echo "source /workspace/.venv/bin/activate" >> ~/.bashrc
31+
32+
33+
34+
35+

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "spark-custom-data-sources-server",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "."
6+
},
7+
"postStartCommand": "bash -i /workspace/scripts/init-env.sh",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"ms-python.vscode-pylance",
12+
"ms-python.python",
13+
"ms-python.debugpy",
14+
"ms-python.autopep8",
15+
"dbaeumer.vscode-eslint",
16+
"ms-toolsai.jupyter",
17+
"ms-toolsai.vscode-jupyter-cell-tags",
18+
"ms-toolsai.jupyter-renderers",
19+
"ms-toolsai.vscode-jupyter-slideshow",
20+
"ms-toolsai.jupyter-keymap"
21+
]
22+
}
23+
}
24+
}

.devcontainer/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
poetry

.devcontainer/scripts/init-env.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# Define the virtual environment directory
4+
VENV_DIR=".venv"
5+
6+
# Check if the virtual environment already exists
7+
if [[ ! -d "$VENV_DIR" ]]; then
8+
echo "Creating virtual environment..."
9+
python -m venv "$VENV_DIR"
10+
echo "Virtual environment created at $VENV_DIR"
11+
else
12+
echo "Virtual environment already exists."
13+
fi
14+
15+
# Activate the virtual environment
16+
if [[ -f "$VENV_DIR/bin/activate" ]]; then
17+
echo "Activating virtual environment..."
18+
source "$VENV_DIR/bin/activate"
19+
echo "Virtual environment activated."
20+
poetry add ipykernel
21+
poetry install
22+
23+
source .venv/bin/activate
24+
25+
else
26+
echo "Error: Unable to activate virtual environment."
27+
exit 1
28+
fi

.gitignore

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# PyPI configuration file
171+
.pypirc

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 23.1.0
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/PyCQA/isort
7+
rev: 5.12.0
8+
hooks:
9+
- id: isort
10+
- repo: https://github.com/pre-commit/mirrors-mypy
11+
rev: v1.0
12+
hooks:
13+
- id: mypy

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"python.defaultInterpreterPath": ".venv/bin/python",
3+
"python.formatting.provider": "black",
4+
"editor.formatOnSave": true,
5+
"editor.codeActionsOnSave": {
6+
"source.organizeImports": "always"
7+
}
8+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Ganesh R
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)