Skip to content

Commit

Permalink
Merge branch 'rc/1.2.6' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtcppv committed Mar 20, 2024
2 parents 5cad637 + 2930e37 commit 19ba8e8
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 76 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ jobs:
path: rest-test-results
front-end-tests:
machine:
image: ubuntu-2004:202010-01
resource_class: xlarge
image: default
steps:
- attach_workspace:
at: ~/
Expand Down
2 changes: 1 addition & 1 deletion containers/postgis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN sed -i "s;http://archive.ubuntu.com/ubuntu/;${APT_REPO_HOST};" /etc/apt/sour

WORKDIR /work
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential git ca-certificates postgresql-server-dev-14 cron && rm -rf /var/lib/apt/lists
build-essential git ca-certificates postgresql-server-dev-14 clang-11 llvm-11 cron && rm -rf /var/lib/apt/lists
RUN git clone --branch v0.4.4 https://github.com/pgvector/pgvector.git
WORKDIR /work/pgvector
RUN make
Expand Down
2 changes: 1 addition & 1 deletion scripts/packages/tator-js
2 changes: 1 addition & 1 deletion scripts/packages/tator-py
2 changes: 1 addition & 1 deletion test/test_playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def test_playback_schedule_1fps(page_factory, project, count_1fps_test):
page.close()


@pytest.mark.flaky(reruns=2)
@pytest.mark.skip(reason="Too flaky")
def test_concat(page_factory, project, concat_test):
print("[Video] Going to annotation view...")
page = page_factory(f"{os.path.basename(__file__)}__{inspect.stack()[0][3]}")
Expand Down
78 changes: 24 additions & 54 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"d3": "7.3.0",
"express": "^4.18.2",
"express-http-proxy": "^1.6.3",
"fetch-retry": "5.0.3",
"fetch-retry": "5.0.6",
"hls.js": "1.2.3",
"isomorphic-fetch": "3.0.0",
"node-fetch": "^2",
"js-yaml": "4.1.0",
"jszip": "^3.8.0",
"libtess": "1.2.0",
Expand Down
52 changes: 50 additions & 2 deletions ui/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ const nunjucks = require('nunjucks');
const favicon = require('serve-favicon');
const proxy = require('express-http-proxy');
const cookieParser = require('cookie-parser');
const originalFetch = require('node-fetch');
const fetch = require('fetch-retry')(originalFetch);
const dns = require('dns');
const yargs = require('yargs/yargs');

dns.setServers([
'8.8.8.8',
'1.1.1.1',
]);
const app = express();

const argv = yargs(process.argv.slice(2))
Expand Down Expand Up @@ -156,6 +164,8 @@ app.post('/exchange', async (req, res) => {
const url = `${argv.backend}/auth/realms/tator/protocol/openid-connect/token`;
try {
await fetch(url, {
retries: 10,
retryDelay: 100,
method: "POST",
body: body,
headers: {
Expand Down Expand Up @@ -193,11 +203,15 @@ app.post('/exchange', async (req, res) => {
});
})
.catch((error) => {
console.error(`Error in exchange endpoint: ${error}`);
console.error(`Error in fetch for exchange: ${error}`);
console.error(error.message);
console.error(error.stack);
return Promise.reject(error);
});
} catch (error) {
console.error(`Error in exchange endpoint: ${error}`);
console.error(error.message);
console.error(error.stack);
res.status(403).send({message: "Failed to retrieve access token!"});
}
});
Expand All @@ -213,6 +227,8 @@ app.get('/refresh', async (req, res) => {
const url = `${argv.backend}/auth/realms/tator/protocol/openid-connect/token`;
try {
await fetch(url, {
retries: 10,
retryDelay: 100,
method: "POST",
body: body,
headers: {
Expand Down Expand Up @@ -249,16 +265,48 @@ app.get('/refresh', async (req, res) => {
});
})
.catch((error) => {
console.error(`Error in refresh endpoint: ${error}`);
console.error(`Error in fetch for refresh: ${error}`);
console.error(error.message);
console.error(error.stack);
return Promise.reject(error);
});
} catch (error) {
console.error(`Error in refresh endpoint: ${error}`);
console.error(error.message);
console.error(error.stack);
res.status(403).send({message: "Failed to refresh access token!"});
}
}
});

app.get('/dnstest', async (req, res) => {
try {
await fetch(argv.backend, {
retries: 10,
retryDelay: 100,
method: "GET",
})
.then(response => {
if (!response.ok) {
console.error(`Error: Request failed with status ${response.status} ${response.statusText}`);
throw new Error("Response from backend failed!");
}
res.status(200).send({message: "DNS was resolved!"});
})
.catch((error) => {
console.error(`Error in fetch to backend: ${error}`);
console.error(error.message);
console.error(error.stack);
return Promise.reject(error);
});
} catch (error) {
console.error(`Error in DNS test: ${error}`);
console.error(error.message);
console.error(error.stack);
res.status(400).send({message: "DNS test failed!"});
}
});

app.listen(argv.port, argv.host, () => {
console.log('Started express server!');
});
Expand Down
13 changes: 2 additions & 11 deletions ui/server/static/oidc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ function exchangeAuthToken () {
const searchParams = currentUrl.searchParams;
const origin = currentUrl.origin;
const code = searchParams.get("code");
const next = searchParams.get("state");
fetch("/exchange", {
method: "POST",
credentials: "same-origin",
Expand All @@ -28,18 +27,10 @@ function exchangeAuthToken () {
localStorage.setItem("id_token", data.id_token);
localStorage.setItem("token_type", data.token_type);
localStorage.setItem("issue_time", issueTime.toISOString());
if (next) {
if (next[0] == '/') {
window.location.href = next;
} else {
window.location.href = "/projects";
}
} else {
window.location.href = "/projects";
}
window.location.href = "/projects";
})
.catch((error) => {
console.error("Error exchanging token!");
window.location.href = `/accounts/login&state=${window.location.pathname}`;
window.location.href = `/accounts/login`;
});
}
2 changes: 1 addition & 1 deletion ui/server/static/require-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getCookie(name) {

function goToLogin() {
if (KEYCLOAK_ENABLED) {
window.location.href = `/accounts/login&state=${window.location.pathname}`;
window.location.href = `/accounts/login`;
} else {
window.location.href = `/accounts/login?next=${window.location.pathname}`;
}
Expand Down

0 comments on commit 19ba8e8

Please sign in to comment.