Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dryruffian committed Oct 27, 2024
2 parents 46a6296 + 6e3260b commit 24eeed0
Show file tree
Hide file tree
Showing 98 changed files with 1,212 additions and 1,760 deletions.
23 changes: 17 additions & 6 deletions catalog/dags/data_refresh/distributed_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from common import elasticsearch as es
from common.constants import (
AWS_CONN_ID,
OPENLEDGER_API_CONN_ID,
POSTGRES_API_CONN_IDS,
PRODUCTION,
Environment,
)
Expand Down Expand Up @@ -129,7 +129,7 @@ def get_launch_template_version_number(
raise AirflowSkipException("Skipping instance creation in local environment.")

launch_templates = ec2_hook.conn.describe_launch_templates(
LaunchTemplateNames=INDEXER_LAUNCH_TEMPLATES.get(target_environment)
LaunchTemplateNames=[INDEXER_LAUNCH_TEMPLATES.get(target_environment)]
)
return launch_templates.get("LaunchTemplates")[0].get("LatestVersionNumber")

Expand Down Expand Up @@ -195,7 +195,10 @@ def wait_for_worker(

result = ec2_hook.conn.describe_instance_status(InstanceIds=[instance_id])

instance_status = result.get("InstanceStatuses", [])[0]
logger.info(result)

instance_statuses = result.get("InstanceStatuses", [])
instance_status = instance_statuses[0] if instance_statuses else {}
state = instance_status.get("InstanceState", {}).get("Name")
status = next(
(
Expand Down Expand Up @@ -236,6 +239,7 @@ def get_instance_ip_address(
trigger_rule=TriggerRule.NONE_FAILED
)
def create_connection(
environment: str,
instance_id: str,
media_type: str,
server: str,
Expand All @@ -246,9 +250,15 @@ def create_connection(
"""
worker_conn_id = f"indexer_worker_{instance_id or media_type}"

# TODO: Locally we use 8003 to avoid collision with the legacy indexer worker that's
# part of the ingestion server. When the ingestion server and legacy data refresh are
# removed, we should modify the local environment to use 8002 here as well and
# avoid having to do this check.
port = "8003" if environment != PRODUCTION else "8002"

# Create the Connection
logger.info(f"Creating connection with id {worker_conn_id}")
worker_conn = Connection(conn_id=worker_conn_id, uri=f"http://{server}:8003/")
worker_conn = Connection(conn_id=worker_conn_id, uri=f"http://{server}:{port}/")
session = settings.Session()
session.add(worker_conn)
session.commit()
Expand Down Expand Up @@ -333,6 +343,7 @@ def reindex(
)

worker_conn = create_connection(
environment=environment,
instance_id=instance_id,
media_type=data_refresh_config.media_type,
server=instance_ip_address,
Expand Down Expand Up @@ -376,7 +387,7 @@ def reindex(

drop_conn = drop_connection(worker_conn=worker_conn)

instance_id >> [await_worker, instance_ip_address]
instance_id >> await_worker >> [instance_ip_address, worker_conn]
worker_conn >> trigger_reindexing_task >> wait_for_reindexing_task
wait_for_reindexing_task >> [terminate_instance, drop_conn, status]

Expand All @@ -394,7 +405,7 @@ def perform_distributed_reindex(
"""Perform the distributed reindex on a fleet of remote indexer workers."""
id_range = PGExecuteQueryOperator(
task_id="get_record_id_range",
conn_id=OPENLEDGER_API_CONN_ID,
conn_id=POSTGRES_API_CONN_IDS.get(target_environment),
sql=dedent(
f"""
SELECT min(id), max(id) FROM {data_refresh_config.table_mapping.temp_table_name};
Expand Down
13 changes: 10 additions & 3 deletions catalog/dags/maintenance/rotate_envfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ def retrieve_recent_launch_template_envfiles(
for lt_version in lt_versions["LaunchTemplateVersions"]:
lt_data = lt_version["LaunchTemplateData"]
if "TagSpecifications" not in lt_data:
lt_id_version = (
f"{lt_version['LaunchTemplateId']}:{lt_version['VersionNumber']}"
)
logger.warning(
"Skipping %s due to lack of tag specifications. This is probably because the launch template was created before tag specifications were properly configured."
"Skipping %s due to lack of tag specifications. This is probably "
"because the launch template was created before tag "
"specifications were properly configured.",
lt_id_version,
)
continue

Expand All @@ -105,8 +111,9 @@ def retrieve_recent_launch_template_envfiles(
None,
)
if instance_tag_spec is None:
# We've already checked if tag specs existed above. If the instance tags don't exist but other tag specs do
# then there's a larger problem that requires investigation.
# We've already checked if tag specs existed above. If the instance
# tags don't exist but other tag specs do then there's a larger
# problem that requires investigation.
raise ValueError(
f"Unable to find instance tags for launch template {lt_name}"
)
Expand Down
3 changes: 2 additions & 1 deletion catalog/dags/providers/provider_api_scripts/europeana.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def _get_filesize(self, item_data: dict) -> int:
return item_data.get("ebucoreFileByteSize")

@staticmethod
def _get_creator(self, data: dict) -> str | None:
@staticmethod
def _get_creator(data: dict) -> str | None:
creators = data.get("dcCreator", [])
if isinstance(creators, list):
if not creators:
Expand Down
21 changes: 21 additions & 0 deletions documentation/changelogs/frontend/2024.10.24.04.16.14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 2024.10.24.04.16.14

## Internal Improvements

- Update dependency vite to v5.4.6 [SECURITY]
([#5068](https://github.com/WordPress/openverse/pull/5068)) by @openverse-bot
- Update dependency pinia to v2.2.4
([#5064](https://github.com/WordPress/openverse/pull/5064)) by @openverse-bot
- Update dependency nuxt to v3.13.2
([#5012](https://github.com/WordPress/openverse/pull/5012)) by @openverse-bot
- Update dependency @actions/github to v6
([#5065](https://github.com/WordPress/openverse/pull/5065)) by @openverse-bot
- Update dependency @vueuse/core to v11
([#5066](https://github.com/WordPress/openverse/pull/5066)) by @openverse-bot

## Bug Fixes

- Exclude `ar` from k6 load testing
([#5070](https://github.com/WordPress/openverse/pull/5070)) by @obulat
- Fix token in #4991 ([#5062](https://github.com/WordPress/openverse/pull/5062))
by @obulat
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Openverse frontend",
"private": true,
"version": "2.2.1",
"packageManager": "[email protected].1",
"packageManager": "[email protected].2",
"scripts": {
"predev": "pnpm install && pnpm i18n:en",
"dev": "run-p dev:only 'i18n:en --watch'",
Expand Down Expand Up @@ -93,8 +93,8 @@
"@storybook-vue/nuxt": "npm:@storybook-vue/nuxt@nightly",
"@testing-library/user-event": "^14.5.2",
"@testing-library/vue": "^8.1.0",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"@vitest/coverage-v8": "^2.1.3",
"@vitest/ui": "^2.1.3",
"@vue/test-utils": "^2.4.6",
"adm-zip": "^0.5.14",
"chokidar": "^3.6.0",
Expand All @@ -107,7 +107,7 @@
"rimraf": "^6.0.1",
"talkback": "^4.2.0",
"typescript": "5.6.3",
"vitest": "^2.0.5",
"vitest": "^2.1.3",
"vitest-dom": "^0.1.1",
"vue": "3.5.12",
"vue-router": "^4.4.5",
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/VAudioTrack/VWaveform.vue
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const seekTimeLeft = computed(() => ({
<!-- Stroke is calculated from the centre of the path -->
<rect
v-if="waveformDimens.width && waveformDimens.height"
class="stroke-pink-8"
class="stroke-focus"
x="0.75"
y="0.75"
:width="waveformDimens.width - 1.5"
Expand All @@ -377,7 +377,7 @@ const seekTimeLeft = computed(() => ({
/>
<rect
v-if="waveformDimens.width && waveformDimens.height"
class="stroke-white"
class="stroke-white dark:stroke-black"
x="2"
y="2"
:width="waveformDimens.width - 4"
Expand Down Expand Up @@ -431,7 +431,7 @@ const seekTimeLeft = computed(() => ({
<!-- Focus bar -->
<div
v-if="isInteractive && isSeeking"
class="absolute top-0 z-20 hidden h-full flex-col items-center justify-between bg-black group-focus/waveform:flex group-focus:flex"
class="absolute top-0 z-20 hidden h-full flex-col items-center justify-between bg-black group-focus/waveform:flex group-focus:flex dark:bg-white"
:style="{ width: `${barWidth}px`, left: `${progressBarWidth}px` }"
>
<div
Expand All @@ -440,7 +440,7 @@ const seekTimeLeft = computed(() => ({
bottom: ['translate-y-1/2'],
}"
:key="name"
class="h-2 w-2 transform rounded-full bg-black"
class="h-2 w-2 transform rounded-full bg-black dark:bg-white"
:class="classes"
>
&nbsp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const handleTab = (
class="search-bar group flex h-12 w-full flex-row items-center overflow-hidden rounded-sm"
:class="
isSearchBarActive || isInputFocused
? 'bg-default ring ring-pink-8'
? 'bg-default ring ring-focus'
: 'bg-surface'
"
@submit.prevent="handleFormSubmit"
Expand Down Expand Up @@ -299,7 +299,7 @@ const handleTab = (
name="q"
:placeholder="$t('hero.search.placeholder')"
type="search"
class="search-field ms-1 h-full w-full flex-grow appearance-none rounded-none border-tx bg-tx text-2xl text-secondary placeholder-gray-8 hover:text-default hover:placeholder-gray-12 focus-visible:outline-none"
class="search-field ms-1 h-full w-full flex-grow appearance-none rounded-none border-tx bg-tx text-2xl text-secondary placeholder-default hover:text-default focus-visible:outline-none"
:value="localSearchTerm"
:aria-label="
$t('search.searchBarLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ withDefaults(
<template>
<VButton :aria-label="label" size="large" variant="plain--avoid" icon-only>
<span
class="relative flex h-8 w-8 flex-none items-center justify-center rounded-sm border border-tx group-focus-visible/button:ring group-focus-visible/button:ring-pink-8 group-active/button:ring group-active/button:ring-pink-8"
class="relative flex h-8 w-8 flex-none items-center justify-center rounded-sm border border-tx group-focus-visible/button:ring group-focus-visible/button:ring-focus group-active/button:ring group-active/button:ring-focus"
:class="variant"
>
<VIcon
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/VHeader/VSearchBar/VSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const nonClassAttrs = computed(() => {
v-bind="nonClassAttrs"
v-model="modelMedium"
:placeholder="placeholder || $t('hero.search.placeholder')"
class="search-field flex-grow border-tx bg-secondary text-secondary focus-within:bg-default focus:border-focus group-hover:bg-secondary group-hover:text-default group-hover:focus-within:bg-default"
class="search-field flex-grow border-tx bg-secondary text-secondary focus-within:bg-default focus-visible:border-focus group-hover:text-default"
:label-text="$t('search.searchBarLabel', { openverse: 'Openverse' })"
:connection-sides="['end']"
field-id="search-bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,17 @@ defineExpose({ focusInput })
<template>
<!-- Form action is a fallback for when JavaScript is disabled. -->
<form
id="search-form"
action="/search"
role="search"
class="search-bar group flex h-14 flex-row items-center rounded-sm border-tx bg-default sm:h-16 dark:bg-overlay"
class="group flex h-14 flex-row items-center rounded-sm border-tx bg-default sm:h-16 dark:bg-overlay"
@submit.prevent="handleSearch"
>
<div
class="input-field search-field group flex h-full flex-grow items-center overflow-hidden rounded-sm rounded-e-none border p-0.5px"
class="input-field search-field group flex h-full flex-grow items-center overflow-hidden rounded-sm rounded-e-none border-1.5 border-e-0 pe-2"
:class="[
route === 'home'
? 'border-tx pe-[7px]'
: 'border-1.5 border-e-0 border-black pe-[7.5px] dark:border-tx',
{ 'has-popover': hasPopover },
route === 'home' ? 'border-tx' : 'border-black dark:border-tx',
{ 'has-popover': hasPopover, black: route !== 'home' },
]"
>
<input
Expand All @@ -68,7 +67,7 @@ defineExpose({ focusInput })
type="search"
name="q"
:placeholder="$t('hero.search.placeholder')"
class="paragraph-large md:label-regular focus-visible:outline-style-none ms-4 h-full w-full appearance-none rounded-none bg-tx leading-none text-default placeholder-gray-8 dark:placeholder-gray-4"
class="paragraph-large md:label-regular focus-visible:outline-style-none ms-4 h-full w-full appearance-none rounded-none bg-tx leading-none text-default placeholder-default"
:aria-label="
$t('search.searchBarLabel', {
openverse: 'Openverse',
Expand All @@ -84,10 +83,13 @@ defineExpose({ focusInput })

<style scoped>
.input-field:has(#search-bar:focus-visible) {
@apply border-1.5 border-focus p-0 pe-2;
@apply border-focus;
}
.input-field.has-popover:has(#search-bar:focus-visible) {
@apply border-tx;
}
#search-form:has(button[type="submit"]:focus) .input-field.black {
@apply border-tx;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const activeButtonsTemplate = () => ({
"div",
{
class:
"wrapper rounded-sm bg-default flex justify-between ring ring-pink-8-8",
"wrapper rounded-sm bg-default flex justify-between ring ring-focus",
},
[
h(VSearchBarButton, {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/VInputField/VInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ defineExpose({ focusInput })

<template>
<div
class="input-field group flex h-12 flex-row items-center overflow-hidden rounded-sm border p-0.5px focus-within:border-1.5 focus-within:border-focus focus-within:bg-surface focus-within:p-0 group-hover:bg-surface"
class="input-field group flex h-12 flex-row items-center overflow-hidden rounded-sm border p-0.5px focus-within:border-1.5 focus-within:border-focus focus-within:bg-surface focus-within:p-0"
:class="[
{
// Padding is set to 1.5px to accommodate the border that will appear later.
Expand All @@ -79,7 +79,7 @@ defineExpose({ focusInput })
ref="inputEl"
:placeholder="placeholder"
:type="type"
class="ms-4 h-full w-full appearance-none rounded-none bg-tx text-2xl font-semibold leading-none placeholder-gray-8 focus-visible:outline-none md:text-base"
class="ms-4 h-full w-full appearance-none rounded-none bg-tx text-2xl font-semibold leading-none placeholder-default focus-visible:outline-none md:text-base"
:value="modelValue"
:aria-label="labelText"
@input="updateModelValue"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/VSnackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ withDefaults(
<template>
<div
:role="isVisible ? 'alert' : undefined"
class="snackbar fixed bottom-4 z-snackbar rounded-sm bg-black text-over-dark transition-[opacity,transform] duration-500 motion-reduce:transition-opacity ltr:left-4 rtl:right-4"
class="snackbar fixed bottom-4 z-snackbar rounded-sm bg-black text-white transition-[opacity,transform] duration-500 motion-reduce:transition-opacity ltr:left-4 rtl:right-4"
:class="[
size === 'large'
? 'w-max max-w-[calc(100%_-_2_*_theme(spacing.4))] flex-row items-center px-6 py-4 text-sm'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/VTabs/VTabPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const panelVariantStyle = computed(() =>
:aria-labelledby="`tab-${id}`"
role="tabpanel"
:tabindex="isSelected ? 0 : -1"
class="min-h-0 overflow-y-auto border-overlay p-6"
class="min-h-0 overflow-y-auto border-default p-6"
:class="[panelVariantStyle, { hidden: !isSelected }]"
>
<slot />
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ const handleSearch = (searchTerm: string) => {
class="index flex w-full flex-shrink-0 flex-grow flex-col justify-center gap-6 px-6 sm:px-0 xl:flex-row xl:items-center xl:justify-between xl:gap-0"
>
<div
class="flex flex-grow flex-col items-center justify-center gap-6 xl:h-[33rem] xl:flex-grow-0 xl:items-start"
class="grid flex-grow place-items-center justify-center gap-6 xl:h-[33rem] xl:flex-grow-0 xl:items-start"
>
<VDarkModeFeatureNotice
v-if="showThemeSwitcher && !isDarkModeSeen"
class="sm:mx-14 md:mx-20 lg:mx-26 xl:me-0"
class="notice self-start lg:ms-26 xl:justify-self-start"
/>

<VHomepageContent
class="my-auto sm:px-14 md:px-20 lg:px-26 xl:w-[53.375rem] xl:pe-0"
class="page-content my-auto sm:px-14 md:px-20 lg:px-26 xl:w-[53.375rem] xl:pe-0"
:handle-search="handleSearch"
:search-type="searchType"
:set-search-type="setSearchType"
Expand All @@ -109,6 +109,10 @@ const handleSearch = (searchTerm: string) => {
</template>

<style>
.page-content,
.notice {
grid-area: 1/1;
}
@screen lg {
.homepage-images {
transform: translateY(-7.143vh);
Expand Down
3 changes: 3 additions & 0 deletions frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ export default {
curr: "currentColor",
current: "currentColor",
},
placeholderColor: {
default: "var(--color-text-secondary)",
},
spacing: {
// Constants
"0.5px": "0.5px",
Expand Down
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.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"scripts": {
"prepare:nuxt": "pnpm --filter frontend run prepare:nuxt"
},
"packageManager": "[email protected].1",
"packageManager": "[email protected].2",
"engines": {
"node": ">= 20.0.0 <21"
"node": ">= 21.0.0 <23"
},
"devDependencies": {
"@types/node": "22.5.1",
"@types/node": "22.8.1",
"@openverse/eslint-plugin": "workspace:*",
"bindings": "1.5.0",
"prettier": "3.3.3",
Expand Down
Loading

0 comments on commit 24eeed0

Please sign in to comment.