Skip to content
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
12 changes: 1 addition & 11 deletions docs/concepts/ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,7 @@ This will do the following:
3. Start the backend server
4. Start the frontend server

This takes a bit of time! So be patient. The server will be running on port 3000 -- in the logs you'll see something like this:

.. code-block:: bash

2024-04-18 15:57:07 You can now view frontend in the browser.
2024-04-18 15:57:07
2024-04-18 15:57:07 Local: http://localhost:3000
2024-04-18 15:57:07 On Your Network: http://172.19.0.4:3000


Then navigate to ``http://localhost:3000`` in your browser, and enter your email (this will be the username used within the app).
This takes a bit of time! So be patient. The server will be running on port 8242. Then navigate to ``http://localhost:8242`` in your browser, and enter your email (this will be the username used within the app).

Building the Docker Images locally
__________________________________
Expand Down
2 changes: 1 addition & 1 deletion ui/backend/server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -e

python manage.py migrate # Apply database migrations
python manage.py runserver 0.0.0.0:8000 # Start the server
python manage.py runserver 0.0.0.0:8241 # Start the server
1 change: 1 addition & 0 deletions ui/backend/server/server/default_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def root_index(request) -> HttpResponse:
<header></header>
<body>
<h1><center>Welcome to the backend server!</center></h1>
<p><center>Did you mean to visit the <a href="http://localhost:8242">frontend</a>? Note this sometimes takes a bit of time to start up.</center> </p>
</body>
</html>
"""
Expand Down
4 changes: 3 additions & 1 deletion ui/deployment/Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ENV NODE_OPTIONS="--max-old-space-size=8192"

RUN npm run build

EXPOSE 3000
EXPOSE 8242

ENV PORT=8242

CMD ["npm", "run", "start"]
4 changes: 3 additions & 1 deletion ui/deployment/Dockerfile.frontend-prod
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /usr/src/app/build /usr/share/nginx/html

# Expose port 80 to the outside once the container has launched
EXPOSE 3000
EXPOSE 8242

# Use the default nginx.conf provided by tiangolo/nginx-rtmp
COPY ./deployment/nginx/nginx.conf /etc/nginx/nginx.conf

CMD ["echo", "Frontend running on port 8242, go to http://localhost:8242 to view the app."]

# Start Nginx and keep the process from backgrounding and the container from quitting
CMD ["nginx", "-g", "daemon off;"]
4 changes: 2 additions & 2 deletions ui/deployment/docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
dockerfile: deployment/Dockerfile.backend-prod
entrypoint: ["/bin/bash", "-c", "cd /code/server && ls && ./entrypoint.sh"]
ports:
- "8000:8000"
- "8241:8241"
environment:
- DB_HOST=db
- DB_PORT=5432
Expand All @@ -49,7 +49,7 @@ services:
- REACT_APP_AUTH_MODE=local
- REACT_APP_USE_POSTHOG=false
ports:
- "3000:3000"
- "8242:8242"
environment:
- NODE_ENV=development
- REACT_APP_AUTH_MODE=local
Expand Down
6 changes: 3 additions & 3 deletions ui/deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- ./backend:/code
- backend_data:/data/
ports:
- "8000:8000"
- "8241:8241"
environment:
- DB_HOST=db
- DB_PORT=5432
Expand All @@ -52,12 +52,12 @@ services:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
ports:
- "3000:3000"
- "8242:8242"
environment:
- NODE_ENV=development
- REACT_APP_AUTH_MODE=local
- REACT_APP_USE_POSTHOG=false
- REACT_APP_API_URL=http://backend:8000
- REACT_APP_API_URL=http://backend:8241
depends_on:
- backend

Expand Down
6 changes: 3 additions & 3 deletions ui/deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ http {
default_type application/octet-stream;

server {
listen 3000;
listen 8242;
server_name localhost;

root /usr/share/nginx/html; # Common root for all files.
Expand All @@ -23,7 +23,7 @@ http {

# Proxy /api requests to backend
location /api {
proxy_pass http://backend:8000; # Assuming the API server is on the same host
proxy_pass http://backend:8241;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
Expand All @@ -32,7 +32,7 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 5000; # Timeout setting as per your node configuration
proxy_read_timeout 5000;
}
}
}
2 changes: 1 addition & 1 deletion ui/frontend/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_URL=localhost:8000
REACT_APP_API_URL=localhost:8241
REACT_APP_USE_POSTHOG=false
REACT_APP_AUTH_MODE=local
6 changes: 3 additions & 3 deletions ui/frontend/src/components/common/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Listbox, Transition } from "@headlessui/react";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/20/solid";
import React, { Fragment } from "react";
import { AiFillQuestionCircle } from "react-icons/ai";
import { IconType } from "react-icons/lib";
import { classNames } from "../../utils";
import { HelpTooltip } from "./HelpTooltip";

type Selectable = {
name: string;
// eslint-disable-next-line
value: any;
icon?: IconType;
};

export const DropdownSelector: React.FC<{
choices: Selectable[];
setCurrentChoice: (choice: any) => void;
currentChoice: any | null;
setCurrentChoice: (choice: Selectable) => void;
currentChoice: Selectable | null;
title: string;
description?: string;
}> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const INSTALL_CODE = `# be sure to initialize any python environment you want to
pip install hamilton[sdk]`;

export const UsingHamiltonAlready = (props: {
projectId: string;
projectId: string | undefined;
username: string;
}) => {
const exampleCode = `
Expand Down Expand Up @@ -62,7 +62,7 @@ dr = (
};

export const NotUsingHamiltonYet = (props: {
projectId: string;
projectId: string | undefined;
username: string;
}) => {
const initCode = `\
Expand Down Expand Up @@ -108,22 +108,24 @@ cd hamilton/examples/hamilton_ui
<div className="flex flex-row gap-2 items-center">
<CheckBox />

<p className="text-sm text-gray-500">
<Link
className="text-dwlightblue hover:underline"
to={`/dashboard/project/${props.projectId}/runs`}
>
Track your runs!
</Link>
</p>
{props.projectId !== undefined && (
<p className="text-sm text-gray-500">
<Link
className="text-dwlightblue hover:underline"
to={`/dashboard/project/${props.projectId}/runs`}
>
Track your runs!
</Link>
</p>
)}
</div>
</li>
</>
);
};

export const ProjectLogInstructions = (props: {
projectId: number;
projectId?: number;
username: string;
canWrite: boolean;
hideHeader?: boolean;
Expand Down Expand Up @@ -216,12 +218,12 @@ export const ProjectLogInstructions = (props: {
</div>
{currentTab === USING_HAMILTON ? (
<UsingHamiltonAlready
projectId={props.projectId.toString()}
projectId={props.projectId?.toString()}
username={props.username}
/>
) : (
<NotUsingHamiltonYet
projectId={props.projectId.toString()}
projectId={props.projectId?.toString()}
username={props.username}
/>
)}
Expand Down
8 changes: 5 additions & 3 deletions ui/frontend/src/components/dashboard/Project/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const ProjectCreateOrEditForm = (props: ProjectCreateFormProps) => {
? "Project description is required"
: undefined,
selectedWriteSharingEntities.length === 0
? "Write access is required by at least one user/team"
? "Write access is required by at least one user (or team, if using the enterprise version)"
: undefined,
].filter((item) => item !== undefined);

Expand Down Expand Up @@ -288,7 +288,8 @@ export const ProjectCreateOrEditForm = (props: ProjectCreateFormProps) => {
Read Access
</label>
<p className="mt-1 text-sm leading-6 text-gray-600 w-full">
Enter emails or select teams you are a part of.
Enter emails
{localMode ? " (reach out if you want team/organization-level ACLs)" : " or select teams you are part of."}.
</p>
<div className="mt-2">
<CreatableSelect
Expand Down Expand Up @@ -337,7 +338,8 @@ export const ProjectCreateOrEditForm = (props: ProjectCreateFormProps) => {
Write Access
</label>
<p className="mt-1 text-sm leading-6 text-gray-600 w-full">
Enter emails or select teams you are a part of.
Enter emails
{localMode ? " (reach out if you want team/organization-level ACLs)" : " or select teams you are part of."}.
</p>
<div className="mt-2">
<CreatableSelect
Expand Down
2 changes: 1 addition & 1 deletion ui/frontend/src/ee/auth/LocalAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const LocalAccount = () => {
<div className="mt-20">
<h1 className="text-3xl font-bold text-gray-700 pl-5 pb-4">Email: {localAccount}</h1>
<ProjectLogInstructions
projectId={1}
projectId={undefined}
username={localAccount || ""}
canWrite={true}
hideAPIKey
Expand Down
4 changes: 2 additions & 2 deletions ui/sdk/src/hamilton_sdk/api/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
HAMILTON_API_URL = "http://localhost:8000"
HAMILTON_UI_URL = "http://localhost:3000"
HAMILTON_API_URL = "http://localhost:8241"
HAMILTON_UI_URL = "http://localhost:8242"