Skip to content

Commit bd80ddf

Browse files
committed
feat: initializing repo!
1 parent 3e79a83 commit bd80ddf

File tree

218 files changed

+25192
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+25192
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.github/
2+
3+
.coverage/
4+
.coverage
5+
coverage
6+
7+
venv/
8+
.env

.env.example

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
AUTOMATION_DB_COLLECTION=
2+
AUTOMATION_DB_NAME=
3+
MONGODB_HOST=
4+
MONGODB_PASS=
5+
MONGODB_PORT=
6+
MONGODB_USER=
7+
NEO4J_DB=
8+
NEO4J_HOST=
9+
NEO4J_PASSWORD=
10+
NEO4J_PORT=
11+
NEO4J_PROTOCOL=
12+
NEO4J_USER=
13+
RABBIT_HOST=
14+
RABBIT_PASSWORD=
15+
RABBIT_PORT=
16+
RABBIT_USER=
17+
REDIS_HOST=
18+
REDIS_PASSWORD=
19+
REDIS_PORT=
20+
SAGA_DB_COLLECTION=
21+
SAGA_DB_NAME=
22+
SENTRY_DSN=
23+
SENTRY_ENV=

.github/workflows/production.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Production CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
ci:
10+
uses: TogetherCrew/operations/.github/workflows/ci.yml@main
11+
secrets:
12+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
13+
package_publish:
14+
needs: ci
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.10"]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip setuptools wheel twine
29+
- name: Build package
30+
run: |
31+
python setup.py sdist bdist_wheel
32+
- name: Publish package to PyPI
33+
env:
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
36+
run: |
37+
python -m twine upload dist/*

.github/workflows/start.staging.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Staging CI/CD Pipeline
2+
3+
on: pull_request
4+
5+
jobs:
6+
ci:
7+
uses: TogetherCrew/operations/.github/workflows/ci.yml@main
8+
secrets:
9+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

.gitignore

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

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# It's recommended that we use `bullseye` for Python (alpine isn't suitable as it conflcts with numpy)
2+
FROM python:3.10-bullseye AS base
3+
WORKDIR /project
4+
COPY . .
5+
RUN pip3 install -r requirements.txt
6+
7+
FROM base AS test
8+
RUN chmod +x docker-entrypoint.sh
9+
CMD ["./docker-entrypoint.sh"]
10+
11+
FROM base AS prod
12+
CMD ["python3", "server.py"]

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# TC-Analyzer-lib
2+
3+
This repository contains the codes to analyze different platform's data. It includes the scripts to compute heatmaps, memberactivities and graph analytics such as degree centrality, Louvain modularity, local clustering coefficient.
4+
5+
To install the library you could follow the
6+
7+
```bash
8+
pip install tc-analyzer-lib
9+
```

docker-compose.dev.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: "3.9"
2+
3+
services:
4+
redis:
5+
image: "redis:7.0.12-alpine"
6+
ports:
7+
- 6379:6379
8+
mongo:
9+
image: "mongo:6.0.8"
10+
ports:
11+
- 27017:27017
12+
environment:
13+
- MONGO_INITDB_ROOT_USERNAME=root
14+
- MONGO_INITDB_ROOT_PASSWORD=pass
15+
rabbitmq:
16+
image: "rabbitmq:3-management-alpine"
17+
ports:
18+
- 5672:5672
19+
environment:
20+
- RABBITMQ_DEFAULT_USER=root
21+
- RABBITMQ_DEFAULT_PASS=pass
22+
neo4j:
23+
image: "neo4j:5.9.0"
24+
ports:
25+
- 7687:7687
26+
- 7474:7474
27+
environment:
28+
- NEO4J_AUTH=neo4j/password
29+
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
30+
- NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.*

docker-compose.example.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "3.9"
2+
3+
services:
4+
server:
5+
build:
6+
context: .
7+
target: prod
8+
dockerfile: Dockerfile
9+
command: python3 server.py
10+
worker:
11+
build:
12+
context: .
13+
target: prod
14+
dockerfile: Dockerfile
15+
command: python3 worker.py

0 commit comments

Comments
 (0)