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

Warn when setting up a system with local or mem block adapters #2002

Merged
merged 18 commits into from
Jun 9, 2021

Conversation

arielshaqed
Copy link
Contributor

These are great for quick setup, but should not be used in production. Warn about it 3 ways:

UI

On the setup page:
"setup" page says: Block adapter "local" not usable in production

Terminal

During startup:


 ██       ██                           ██                 
░██      ░██                          ░░                  ░██
░██   █  ░██  ██████   ██████ ███████  ██ ███████   █████ ░██
░██  ███ ░██ ░░░░░░██ ░░██░░█░░██░░░██░██░░██░░░██ ██░░░██░██
░██ ██░██░██  ███████  ░██ ░  ░██  ░██░██ ░██  ░██░██  ░██░██
░████ ░░████ ██░░░░██  ░██    ░██  ░██░██ ░██  ░██░░██████░░ 
░██░   ░░░██░░████████░███    ███  ░██░██ ███  ░██ ░░░░░██ ██
░░       ░░  ░░░░░░░░ ░░░    ░░░   ░░ ░░ ░░░   ░░   █████ ░░ 
                                                   ░░░░░  
Using the "local" block adapter.  This is suitable only for testing, but not
for production.

Logs

Also write an error on startup:

ERROR  [2021-05-26T09:54:55+03:00]cmd/lakefs/cmd/run.go:112 cmd/lakefs/cmd.glob..func9 Block adapter NOT SUPPORTED for production use  adapter_type=local

@arielshaqed arielshaqed requested a review from ozkatz May 26, 2021 06:58
@arielshaqed arielshaqed linked an issue May 26, 2021 that may be closed by this pull request
@arielshaqed arielshaqed force-pushed the chore/1998-warn-about-local branch 2 times, most recently from d029112 to c8ff5d9 Compare May 26, 2021 07:38
@arielshaqed arielshaqed force-pushed the chore/1998-warn-about-local branch from c8ff5d9 to 54c338b Compare June 1, 2021 14:03
░██ ██░██░██ ███████ ░██ ░ ░██ ░██░██ ░██ ░██░██ ░██░██
░████ ░░████ ██░░░░██ ░██ ░██ ░██░██ ░██ ░██░░██████░░
░██░ ░░░██░░████████░███ ███ ░██░██ ███ ░██ ░░░░░██ ██
░░ ░░ ░░░░░░░░ ░░░ ░░░ ░░ ░░ ░░░ ░░ █████ ░░
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit much, given our quickstart will also show this. I'd do without the big banner..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Let me know if you want a small figlet banner...

@@ -2821,3 +2844,20 @@ paths:
$ref: "#/components/schemas/Config"
401:
$ref: "#/components/responses/Unauthorized"

/warnings:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have /config: Since this is currently only used in the UI, why not have the warning be a client side feature? The startup message already doesn't depend on this API...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to be part of the config. But still generating on the server side: not all warnings can be generated on the client. In any case the GUI client is pretty well tied to the server.

Thing is, now it requires auth so we cannot place it on /setup. Will consult f2f where to place it.


export const Warning = (props) =>
<div className="warning">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className="warning">
<Alert variant="warning">

<TopNavLink href="/repositories">Repositories</TopNavLink>
<TopNavLink href="/auth">Administration</TopNavLink>
</Nav>
<>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hysterical raisins. Removed...

</Route>
</Switch>
</Router>
<>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same leftovers.

@@ -108,4 +126,9 @@ server:
);
};

const SetupPage = () => <>
<SetupWarnings/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks a little out of place. At a minimum it should be on the same grid as the setup form (above it, below it, idc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed F2F, anyway moved to:

  • "Create repo" dialog
  • "Objects" page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the "create repo" modal on the repositories page:
"create repo" modal with warning about using local block adapter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the "upload object" modal on the objects page:
"upload object" modal with warning about using local block adapter

@@ -300,6 +300,16 @@
font-size: 0.85rem;
}

.warning {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use the react-bootstrap component (<Alert variant="warning"/>)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@arielshaqed arielshaqed force-pushed the chore/1998-warn-about-local branch from 5982712 to 8d6f34b Compare June 6, 2021 11:04
Copy link
Contributor Author

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

PTAL (commits mostly organized and non-overlapping, you might want to read them one at a time).

░██ ██░██░██ ███████ ░██ ░ ░██ ░██░██ ░██ ░██░██ ░██░██
░████ ░░████ ██░░░░██ ░██ ░██ ░██░██ ░██ ░██░░██████░░
░██░ ░░░██░░████████░███ ███ ░██░██ ███ ░██ ░░░░░██ ██
░░ ░░ ░░░░░░░░ ░░░ ░░░ ░░ ░░ ░░░ ░░ █████ ░░
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Let me know if you want a small figlet banner...

@@ -2821,3 +2844,20 @@ paths:
$ref: "#/components/schemas/Config"
401:
$ref: "#/components/responses/Unauthorized"

/warnings:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to be part of the config. But still generating on the server side: not all warnings can be generated on the client. In any case the GUI client is pretty well tied to the server.

Thing is, now it requires auth so we cannot place it on /setup. Will consult f2f where to place it.

<TopNavLink href="/repositories">Repositories</TopNavLink>
<TopNavLink href="/auth">Administration</TopNavLink>
</Nav>
<>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hysterical raisins. Removed...

</Route>
</Switch>
</Router>
<>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same leftovers.

@@ -300,6 +300,16 @@
font-size: 0.85rem;
}

.warning {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@@ -108,4 +126,9 @@ server:
);
};

const SetupPage = () => <>
<SetupWarnings/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed F2F, anyway moved to:

  • "Create repo" dialog
  • "Objects" page

@@ -108,4 +126,9 @@ server:
);
};

const SetupPage = () => <>
<SetupWarnings/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the "create repo" modal on the repositories page:
"create repo" modal with warning about using local block adapter

@@ -108,4 +126,9 @@ server:
);
};

const SetupPage = () => <>
<SetupWarnings/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the "upload object" modal on the objects page:
"upload object" modal with warning about using local block adapter

@arielshaqed arielshaqed requested a review from ozkatz June 6, 2021 11:05
@lgtm-com
Copy link

lgtm-com bot commented Jun 6, 2021

This pull request introduces 3 alerts when merging 2e843eda4740abcb15d66bb59d72d1eedbc186b3 into 18b9afc - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@arielshaqed
Copy link
Contributor Author

This pull request introduces 3 alerts when merging 2e843ed into 18b9afc - view on LGTM.com

new alerts:

* 3 for Unused variable, import, function or class

These are fixed, see new report on LGTM.com.

Copy link
Collaborator

@ozkatz ozkatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about incompatible changes with #2056

api/swagger.yml Outdated
@@ -681,6 +681,11 @@ components:
type: string
blockstore_namespace_ValidityRegex:
type: string
warnings:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of conflicts with #2056 - I think we should fold both into a /config/storage endpoint and forgo the server-side warnings API (for now).

@@ -300,6 +300,11 @@
font-size: 0.85rem;
}

.unmarked-list {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for classes with no semantic meaning that simply want to apply a simple style, you can use Bootstrap's spacing classes (see https://getbootstrap.com/docs/4.0/utilities/spacing/#examples)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Done!

@arielshaqed
Copy link
Contributor Author

@ozkatz , I cannot pull this because:

  1. I cannot pull make authorization errors readable in the UI, change /config to require re fs permissions since it returns storage config #2056 because that fails validation. I did rebase on top of fix/2028-uninformative-auth-errors.
  2. You did not approve this one.

Let's (finally...) close this tomorrow!

@arielshaqed arielshaqed force-pushed the chore/1998-warn-about-local branch from 6164ae1 to fe4dee5 Compare June 8, 2021 10:44
@arielshaqed arielshaqed changed the base branch from fix/2028-uninformative-auth-errors to master June 8, 2021 11:04
Copy link
Contributor Author

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Rebased on top of master. @ozkatz , PT1FL ("please take one final look")...

@arielshaqed arielshaqed requested a review from ozkatz June 8, 2021 11:08
Copy link
Collaborator

@ozkatz ozkatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! thanks!

ozkatz and others added 7 commits June 9, 2021 16:27
Currently only shows warning for using local or mem block storages.
Currently this warns when setting up with local or mem block adapter.
Not a huge banner.
Adding during branch development to add components but never removed.
@arielshaqed arielshaqed force-pushed the chore/1998-warn-about-local branch from 6da3c48 to 9701ccc Compare June 9, 2021 13:30
@arielshaqed
Copy link
Contributor Author

Thanks!

@arielshaqed arielshaqed merged commit 3fa9391 into master Jun 9, 2021
@arielshaqed arielshaqed deleted the chore/1998-warn-about-local branch June 9, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn about using "local" adapter in production
2 participants