Skip to content
Snippets Groups Projects
Commit 497f89bd authored by Tom Robinson's avatar Tom Robinson
Browse files

Merge branch 'master' of github.com:metabase/metabase into new-e2e-test-setup

parents 8a19a809 f13be5c6
No related branches found
No related tags found
No related merge requests found
Showing
with 182 additions and 62 deletions
......@@ -39,7 +39,7 @@
(project 1)
(qp-expect-with-engines 1)
(render-file 1)
(resolve-private-fns 1)
(resolve-private-vars 1)
(select 1)
(sync-in-context 2)
(when-testing-engine 1)
......
......@@ -25,3 +25,6 @@ indent_size = 4
[*.js]
indent_size = 4
[*.jsx]
indent_size = 4
If this is a bug report, please fill in the blanks:
------
Before filing an issue we'd appreciate it if you could take a moment to ensure
there isn't already an open issue or pull-request.
-----
* I am using the ___________ browser.
* My computer's OS is ___________.
* I'm running Metabase ___________ [locally from the JAR / locally with the Mac App / on AWS / on Herkou / etc.] and it is using the ___________ [Postgres / MySQL / H2 (default)] database.
* My data is in a ___________ database. [Postgres / MySQL / Redshift / BigQuery / MongoDB / SQLite / SQL Server / etc.]
* My Metabase version is ___________.
### Database support
If there's an exisiting issue, please add a +1 in the comments as we
prioritize drivers by the level of support. Otherwise, please include the name
of the database and the version.
### Feature requests and proposals
We're excited to hear how we can make Metabase better. Please add as much detail
as you can on your use case.
### Bugs
If you're filing an issue about a bug please include as much information
as you can including the following.
- Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
- Your operating system: (e.x. OS X 10, Windows XP, etc)
- Your databases: (e.x. MySQL, Postgres, MongoDB, …)
- Metabase version: (e.x. 0.19.3)
- Metabase hosting environment: (e.x. Mac app, Elastic Beanstalk, Docker, Heroku, Linux/Ubuntu 12)
- Metabase internal database: (e.x. H2 (default), MySQL, Postgres)
- *Repeatable steps to reproduce the issue*
Thanks for being part of the Metabase project!
-------
......@@ -41,3 +41,4 @@ bin/release/aws-eb/metabase-aws-eb.zip
/.env
/npm-debug.log
/screenshots
/plugins
......@@ -9,6 +9,7 @@
NSString *JREPath();
NSString *UberjarPath();
NSString *DBPath(); ///< Path to the H2 DB file
NSString *PluginsDirPath(); ///< Path for plugins
/// Base class for running JRE-based NSTasks
@interface JavaTask : NSObject
......
......@@ -16,7 +16,7 @@ NSString *UberjarPath() {
return [[NSBundle mainBundle] pathForResource:@"metabase" ofType:@"jar"];
}
NSString *DBPath() {
NSString *ApplicationSupportDirPath() {
NSString *applicationSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES)[0] stringByAppendingPathComponent:@"Metabase"];
if (![[NSFileManager defaultManager] fileExistsAtPath:applicationSupportDir]) {
NSError *error = nil;
......@@ -25,7 +25,15 @@ NSString *DBPath() {
NSLog(@"Error creating %@: %@", applicationSupportDir, error.localizedDescription);
}
}
return [applicationSupportDir stringByAppendingPathComponent:@"metabase.db"];
return applicationSupportDir;
}
NSString *DBPath() {
return [ApplicationSupportDirPath() stringByAppendingPathComponent:@"metabase.db"];
}
NSString *PluginsDirPath() {
return [ApplicationSupportDirPath() stringByAppendingPathComponent:@"Plugins"];
}
......
......@@ -90,12 +90,13 @@
NSLog(@"Starting MetabaseTask @ 0x%zx...", (size_t)self);
self.task = [[NSTask alloc] init];
self.task.launchPath = JREPath();
self.task.environment = @{@"MB_DB_FILE": DBPath(),
@"MB_JETTY_PORT": @(self.port)};
self.task.arguments = @[@"-Djava.awt.headless=true",
@"-jar", UberjarPath()];
self.task = [[NSTask alloc] init];
self.task.launchPath = JREPath();
self.task.environment = @{@"MB_DB_FILE": DBPath(),
@"MB_PLUGINS_DIR": PluginsDirPath(),
@"MB_JETTY_PORT": @(self.port)};
self.task.arguments = @[@"-Djava.awt.headless=true",
@"-jar", UberjarPath()];
__weak MetabaseTask *weakSelf = self;
self.task.terminationHandler = ^(NSTask *task){
......@@ -109,7 +110,7 @@
});
};
NSLog(@"Launching MetabaseTask\nMB_DB_FILE='%@' MB_JETTY_PORT=%lu %@ -jar %@", DBPath(), self.port, JREPath(), UberjarPath());
NSLog(@"Launching MetabaseTask\nMB_DB_FILE='%@'\nMB_PLUGINS_DIR='%@'\nMB_JETTY_PORT=%lu\n%@ -jar %@", DBPath(), PluginsDirPath(), self.port, JREPath(), UberjarPath());
[self.task launch];
});
}
......
......@@ -15,7 +15,7 @@ static const CGFloat HealthCheckIntervalSeconds = 1.2f;
static const CGFloat HealthCheckRequestTimeout = 0.25f;
/// After this many seconds of being unhealthy, consider the task timed out so it can be killed
static const CFTimeInterval TimeoutIntervalSeconds = 15.0f;
static const CFTimeInterval TimeoutIntervalSeconds = 60.0f;
@interface TaskHealthChecker ()
@property (strong, nonatomic) NSOperationQueue *healthCheckOperationQueue;
......
......@@ -17,7 +17,7 @@ Metabase is the easy, open source way for everyone in your company to ask questi
- Rich beautiful [dashboards](http://www.metabase.com/docs/latest/users-guide/05-sharing-answers) with auto refresh and fullscreen
- SQL Mode for analysts and data pros
- Create canonical [segments and metrics](http://www.metabase.com/docs/latest/administration-guide/05-segments-and-metrics) for your team to use
- Send data to Slack or email on a schedule with [Pulses](http://www.metabase.com/docs/latest/users-guide/07-pulses)
- Send data to Slack or email on a schedule with [Pulses](http://www.metabase.com/docs/latest/users-guide/09-pulses)
- View data in Slack anytime with [Metabot](http://www.metabase.com/docs/latest/users-guide/10-metabot)
- [Humanize data](http://www.metabase.com/docs/latest/administration-guide/03-metadata-editing) for your team by renaming, annotating and hiding fields
......@@ -35,6 +35,7 @@ For more information check out [metabase.com](http://www.metabase.com)
- SQLite
- H2
- Crate
- Oracle
Don't see your favorite database? File an issue to let us know.
......@@ -107,7 +108,7 @@ Metabase also allows you to hit our Query API directly from Javascript to integr
# Danger zone
The button below will deploy the branch where this README.md lives onto Heroku. Metabase developers use it to deploy branches of Metabase to test our PRs, etc. We DO NOT recommend you using this for production. Instead, please use a [stable build](http://metabase.com/start)
The button below will deploy the branch where this README.md lives onto Heroku. Metabase developers use it to deploy branches of Metabase to test our PRs, etc. We DO NOT recommend you using this for production. Instead, please use a [stable build](http://metabase.com/start).
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
......
......@@ -34,7 +34,7 @@ case $CIRCLE_NODE_INDEX in
ENGINES=h2,mongo,mysql,bigquery \
lein test
;;
1) ENGINES=h2,sqlserver \
1) ENGINES=h2,sqlserver,oracle \
MB_DB_TYPE=postgres MB_DB_DBNAME=circle_test MB_DB_PORT=5432 MB_DB_USER=ubuntu MB_DB_HOST=localhost \
lein test
;;
......
......@@ -26,7 +26,7 @@ fi
# Setup Java Options
JAVA_OPTS="-Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
JAVA_OPTS="-Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -server"
if [ ! -z "$JAVA_TIMEZONE" ]; then
JAVA_OPTS="${JAVA_OPTS} -Duser.timezone=${JAVA_TIMEZONE}"
......
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail
if [ $# -gt 0 ] && [ "$1" == "-h" ]; then
cat <<EOM
Usage:
Deploy current branch to Heroku app "metabase-CURRENT_BRANCH_NAME"
./bin/heroku/deploy
Deploy current branch to Heroku app "HEROKU_APP_NAME"
./bin/heroku/deploy "HEROKU_APP_NAME"
Deploy "GIT_REF" (branch or tag) to Heroku app "HEROKU_APP_NAME"
./bin/heroku/deploy "HEROKU_APP_NAME" "GIT_REF"
EOM
exit 0
fi
if [ $# -gt 0 ]; then
heroku_app_name="$1"
else
if [ $(git rev-parse --abbrev-ref HEAD) == "HEAD" ]; then
echo "Detached HEAD. Specify a Heroku app name."
echo ""
echo "For more usage examples: $0 -h"
exit 1
fi
heroku_app_name="metabase-$(git rev-parse --abbrev-ref HEAD)"
fi
if [ $# -gt 1 ]; then
# "peel" annotated tags etc
git_local_ref="+$2^{}"
else
git_local_ref="HEAD"
fi
# use explicit "master" ref in case it doesn't exist yet
git_remote_ref="refs/heads/master"
if ! heroku ps -a "$heroku_app_name" > /dev/null; then
heroku apps:create -n --addons "heroku-postgresql:hobby-dev" "$heroku_app_name"
heroku buildpacks:clear -a "$heroku_app_name"
......@@ -14,6 +51,7 @@ if ! heroku ps -a "$heroku_app_name" > /dev/null; then
heroku buildpacks:add "https://github.com/heroku/heroku-buildpack-clojure" -a "$heroku_app_name"
fi
time git push -f "https://git.heroku.com/$heroku_app_name.git" HEAD:master
echo git push -f "https://git.heroku.com/$heroku_app_name.git" "$git_local_ref:$git_remote_ref"
time git push -f "https://git.heroku.com/$heroku_app_name.git" "$git_local_ref:$git_remote_ref"
heroku open -a "$heroku_app_name"
......@@ -15,6 +15,8 @@ dependencies:
- npm install -g npm@2.15.9
# Forces the Sauce Connect binary to be downloaded during dependencies phase so it's cached
- SAUCE_CONNECT_DOWNLOAD_ON_INSTALL=true npm install
- mkdir plugins
- wget --output-document=plugins/ojdbc7.jar $ORACLE_JDBC_JAR
database:
post:
# MySQL doesn't load named timezone information automatically, you have to run this command to load it
......@@ -22,7 +24,7 @@ database:
test:
override:
# 0) runs unit tests w/ H2 local DB. Runs against H2, Mongo, MySQL, BigQuery
# 1) runs unit tests w/ Postgres local DB. Runs against H2, SQL Server
# 1) runs unit tests w/ Postgres local DB. Runs against H2, SQL Server, Oracle
# 2) runs unit tests w/ MySQL local DB. Runs against H2, Postgres, SQLite, Crate
# 3) runs unit tests w/ H2 local DB. Runs against H2, Redshift, Druid
# 4) runs Eastwood linter, Bikeshed linter, docstring-checker & ./bin/reflection-linter
......
......@@ -16,4 +16,4 @@ export MB_DB_PORT=$RDS_PORT
# TODO: dynamically determine type, probably using the port number
export MB_DB_TYPE=postgres
exec java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase.jar
exec java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -server -jar /app/metabase.jar
......@@ -14,10 +14,13 @@ Now you’ll see a list of your databases. To connect another database to Metaba
* [Google BigQuery](databases/bigquery.md)
* H2
* MongoDB (version 3.0 or higher)
* MySQL
* MySQL (version 4.1 or higher)
* Postgres
* SQLite
* SQL Server
* Driud
* Crate
* [Oracle](databases/oracle.md)
To add a database, you'll need its connection information.
......
......@@ -13,13 +13,13 @@ You should see this form:
![Slack Settings](images/SlackSettings.png)
Then just click on the large and conveniently placed button `Get an API token from Slack` which will open a new browser tab and send you over to Slack to create the token.
Then just click on the large and conveniently placed button `Create a Slack Bot User for Metabot` which will open a new browser tab and send you over to Slack to create the Bot user account.
Click over to the tab that was opened and you'll now be on the Slack API page under the Authentication section which will show you any API tokens that you have created for your various Slack teams.
Click over to the tab that was opened and you'll now be on the Slack Bot creation page.
![Slack API Auth](images/SlackAPIAuth.png)
Now just click the `Create token` button next to the team you want to integrate with and a token will be generated for you. It will look like `xoxp-etc-etc-etc` and all you need to do is copy that value and head back to Metabase.
Now give the Bot user a helpful name (we suggest `Metabot`) and click the `Add bot integration` button and a bot user will be generated for you. Look for the Bot's API token in the next page. It will look like `xoxp-etc-etc-etc` and all you need to do is copy that value and head back to Metabase.
Paste the value into the text box for `Slack API Token` and click the button to save your changes. That's it! Metabase will automatically run a quick test to check that the API token is working properly and if not you'll get an error message.
......
## Working with Oracle in Metabase
Starting in v0.20.0, Metabase provides a driver for connecting to Oracle databases. Under the hood, Metabase uses Oracle's JDBC driver; due to licensing restrictions, we can't
include it as part of Metabase. Luckily, downloading it yourself and making it available to Metabase is straightforward and only takes a few minutes.
### Downloading the Oracle JDBC Driver JAR
You can download the JDBC driver from [Oracle's JDBC driver downloads page](http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html).
Head to this page, accept the license agreement, and download `ojdbc7.jar`:
![Oracle JDBC Download](../images/oracle_jdbc_download.png)
Before downloading this JAR you may need to sign up for a free account with Oracle.
### Adding the Oracle JDBC Driver JAR to the Metabase Plugins Directory
Metabase will automatically make the Oracle driver available if it finds the Oracle JDBC driver JAR in the Metabase plugins directory when it starts up.
All you need to do is create the directory and move the JAR you just downloaded into it.
By default, the plugins directory is called `plugins`, and lives in the same directory as the Metabase JAR.
For example, if you're running Metabase from a directory called `/app/`, you should move the Oracle JDBC driver JAR to `/app/plugins/`:
```bash
# example directory structure for running Metabase with Oracle support
/app/metabase.jar
/app/plugins/ojdbc7.jar
```
If you're running Metabase from the Mac App, the plugins directory defaults to `~/Library/Application Support/Metabase/Plugins/`:
```bash
# example directory structure for running Metabase Mac App with Oracle support
/Users/camsaul/Library/Application Support/Metabase/Plugins/ojdbc7.jar
```
Finally, you can choose a custom plugins directory if the default doesn't suit your needs by setting the environment variable `MB_PLUGINS_DIR`.
docs/administration-guide/images/SlackAPIAuth.png

334 KiB | W: | H:

docs/administration-guide/images/SlackAPIAuth.png

76.4 KiB | W: | H:

docs/administration-guide/images/SlackAPIAuth.png
docs/administration-guide/images/SlackAPIAuth.png
docs/administration-guide/images/SlackAPIAuth.png
docs/administration-guide/images/SlackAPIAuth.png
  • 2-up
  • Swipe
  • Onion skin
docs/administration-guide/images/oracle_jdbc_download.png

26.8 KiB

# Metabase OS X App
NOTE: These instructions are only for packaging a built Metabase uberjar into `Metabase.app`. They are not useful if your goal is to work on Metabase itself; for development, please see our [developers' guide](developers-guide.md).
## Prereqs
1. Install XCode.
......@@ -8,43 +10,43 @@
3. Update Perl. I'm not sure these steps are actually needed, so feel free to try skipping it and come back to it if it fails:
```bash
# Upgrade Perl
brew install perl
# Add new version of perl to your $PATH
# (replace "5.24.0_1" below with whatever version you installed)
echo 'export PATH="/usr/local/Cellar/perl/5.24.0_1/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
# Double-check that we're using the newer version of CPAN
# (If this is your first time running CPAN, use the default config settings when prompted)
cpan --version # You should see a line like "running under Perl version 5.24.0."
```
```bash
# Upgrade Perl
brew install perl
# Add new version of perl to your $PATH
# (replace "5.24.0_1" below with whatever version you installed)
echo 'export PATH="/usr/local/Cellar/perl/5.24.0_1/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
# Double-check that we're using the newer version of CPAN
# (If this is your first time running CPAN, use the default config settings when prompted)
cpan --version # You should see a line like "running under Perl version 5.24.0."
```
4. Next, you'll need to run the following commands before building the app:
```bash
# Fetch and initialize git submodule
git submodule update --init
# Install libcurl (needed by WWW::Curl::Simple (I think))
brew install curl && brew link curl --force
# The new version of LLVM is snippy so have CPAN pass compiler flags to fix errors
# (Make sure this file exists first. If you didn't upgrade Perl in the step above,
# it might be in a different location; perhaps called "Config.pm".
# You may need to run "cpan" (no arguments) to generate an appropriate initial config.
# As above, you can go with the defaults).
sed -i '' -e "s/'make_arg' => q\[\]/'make_arg' => q\[CCFLAGS=\"-Wno-return-type\"\]/" ~/.cpan/CPAN/MyConfig.pm
# Install Perl modules used by ./bin/osx-setup and ./bin/osx-release
# You may have to run this as sudo if you didn't upgrade perl as described in step above
cpan install File::Copy::Recursive JSON Readonly String::Util Text::Caml WWW::Curl::Simple
# Copy JRE and uberjar
./bin/osx-setup
```
# Fetch and initialize git submodule
git submodule update --init
# Install libcurl (needed by WWW::Curl::Simple (I think))
brew install curl && brew link curl --force
# The new version of LLVM is snippy so have CPAN pass compiler flags to fix errors
# (Make sure this file exists first. If you didn't upgrade Perl in the step above,
# it might be in a different location; perhaps called "Config.pm".
# You may need to run "cpan" (no arguments) to generate an appropriate initial config.
# As above, you can go with the defaults).
sed -i '' -e "s/'make_arg' => q\[\]/'make_arg' => q\[CCFLAGS=\"-Wno-return-type\"\]/" ~/.cpan/CPAN/MyConfig.pm
# Install Perl modules used by ./bin/osx-setup and ./bin/osx-release
# You may have to run this as sudo if you didn't upgrade perl as described in step above
cpan install File::Copy::Recursive JSON Readonly String::Util Text::Caml WWW::Curl::Simple
# Copy JRE and uberjar
./bin/osx-setup
```
`./bin/osx-setup` will build run commands to build the uberjar for you if needed.
Run `./bin/osx-setup` again at any time in the future to copy the latest version of the uberjar into the project.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment