Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤹🏻🥔 ↝ [SSG-1]: This was a mistake #54

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
__pycache__
.flaskenv.example

.DS_Store
/.DS_Store

node_modules
/node_modules
./node_modules
Expand Down
27 changes: 13 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
FROM python:3.9.16-bullseye

ENV PROJECT_DIR /app
# Use the official Python image from the Docker Hub
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app
RUN pip install pipenv

# COPY requirements.txt requirements.txt
# RUN pip install -r requirements.txt
# Copy the requirements file into the container
COPY requirements.txt ./

WORKDIR ${PROJECT_DIR}
COPY Pipfile .
# COPY Pipfile.lock .
# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

RUN pipenv install
# RUN pipenv install --system
# RUN pipenv install --system --deploy
# Copy the rest of the application code into the container
COPY . .

# CMD ["python", "-m", "flask", "run", "--host=0.0.0.0"]
CMD ["pipenv", "run", "flask", "run", "--host=0.0.0.0"]
# Expose the port that Flask will run on
EXPOSE 5000

# Command to run the Flask app with live reload enabled (debug mode)
CMD ["flask", "run", "--host=0.0.0.0", "--port=5001", "--reload"]
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
psycopg2 = "*"
flask-sqlalchemy = "*"
lightkurve = "*"

[dev-packages]

[requires]
python_version = "3.9"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added buckets/telescope/telescope-sunspots/97152315.png
Binary file added buckets/telescope/telescope-sunspots/97154417.png
Binary file added buckets/telescope/telescope-sunspots/97187095.png
Binary file added buckets/telescope/telescope-sunspots/97188190.png
Binary file added buckets/telescope/telescope-sunspots/97191316.png
Binary file added buckets/telescope/telescope-sunspots/97195700.png
Binary file added buckets/telescope/telescope-sunspots/97196024.png
Binary file added buckets/telescope/telescope-sunspots/97197366.png
Binary file added buckets/telescope/telescope-sunspots/97198022.png
22 changes: 8 additions & 14 deletions buckets/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

# Initialize Supabase client
def init_supabase_client():
url = "http://127.0.0.1:54321" # Replace with your Supabase URL
key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" # Replace with your key
url = "http://127.0.0.1:54321"
key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0"
return create_client(url, key)

# Upload file to Supabase bucket
def upload_file_to_supabase(supabase: Client, bucket_name: str, file_path: str, destination_path: str):
with open(file_path, "rb") as file:
try:
Expand All @@ -17,28 +16,23 @@ def upload_file_to_supabase(supabase: Client, bucket_name: str, file_path: str,
except Exception as e:
print(f"Failed to upload {file_path} -> {destination_path}: {e}")

# Recursive function to upload all files in directory
def upload_directory_to_supabase(supabase: Client, bucket_name: str, local_directory: str):
for root, dirs, files in os.walk(local_directory):
for file_name in files:
if file_name.startswith('.'):
# Skip hidden files (e.g., .DS_Store)
continue

file_path = os.path.join(root, file_name)

# Create relative path for Supabase storage to mirror local structure

relative_path = os.path.relpath(file_path, local_directory)
destination_path = Path(relative_path).as_posix() # Ensure path uses forward slashes

# Upload file
destination_path = Path(relative_path).as_posix()

upload_file_to_supabase(supabase, bucket_name, file_path, destination_path)

# Main function
def main():
supabase = init_supabase_client()
bucket_name = "clouds" # Use your Supabase bucket name
local_directory = "clouds" # Folder you want to upload (in this case, anomalies)
bucket_name = "zoodex"
local_directory = "zoodex"

upload_directory_to_supabase(supabase, bucket_name, local_directory)

Expand Down
Binary file added buckets/zoodex/zoodex-nestQuestGo/81565879-2.jpeg
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
flask
psycopg2
Flask-SQLAlchemy
lightkurve
Flask==2.3.0
python-dotenv
44 changes: 20 additions & 24 deletions supabase/tables/anomalies.csv

Large diffs are not rendered by default.

Loading