diff --git a/airflow/contrib/operators/__init__.py b/airflow/contrib/operators/__init__.py index aa25423f30510..e6d592f653a5d 100644 --- a/airflow/contrib/operators/__init__.py +++ b/airflow/contrib/operators/__init__.py @@ -174,6 +174,14 @@ "airflow.providers.google.cloud.operators.dataflow.DataflowTemplatedJobStartOperator" ), }, + "datapipeline_operator": { + "CreateDataPipelineOperator": ( + "airflow.providers.google.cloud.operators.datapipeline.CreateDataPipelineOperator" + ), + "RunDataPipelineOperator": ( + "airflow.providers.google.cloud.operators.datapipeline.RunDataPipelineOperator" + ), + }, "dataproc_operator": { "DataprocCreateClusterOperator": ( "airflow.providers.google.cloud.operators.dataproc.DataprocCreateClusterOperator" diff --git a/airflow/providers/google/cloud/hooks/dataflow.py b/airflow/providers/google/cloud/hooks/dataflow.py index 59eee63501864..b8ac8a138093c 100644 --- a/airflow/providers/google/cloud/hooks/dataflow.py +++ b/airflow/providers/google/cloud/hooks/dataflow.py @@ -582,6 +582,11 @@ def get_conn(self) -> Resource: http_authorized = self._authorize() return build("dataflow", "v1b3", http=http_authorized, cache_discovery=False) + def get_pipelines_conn(self) -> build: + """Return a Google Cloud Data Pipelines service object.""" + http_authorized = self._authorize() + return build("datapipelines", "v1", http=http_authorized, cache_discovery=False) + @_fallback_to_location_from_variables @_fallback_to_project_id_from_variables @GoogleBaseHook.fallback_to_default_project_id @@ -1351,6 +1356,132 @@ def is_job_done(self, location: str, project_id: str, job_id: str) -> bool: return job_controller._check_dataflow_job_state(job) + @GoogleBaseHook.fallback_to_default_project_id + def create_data_pipeline( + self, + body: dict, + project_id: str, + location: str = DEFAULT_DATAFLOW_LOCATION, + ): + """ + Create a new Dataflow Data Pipelines instance. + + :param body: The request body (contains instance of Pipeline). See: + https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines/create#request-body + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + + Returns the created Data Pipelines instance in JSON representation. + """ + parent = self.build_parent_name(project_id, location) + service = self.get_pipelines_conn() + request = ( + service.projects() + .locations() + .pipelines() + .create( + parent=parent, + body=body, + ) + ) + response = request.execute(num_retries=self.num_retries) + return response + + @GoogleBaseHook.fallback_to_default_project_id + def get_data_pipeline( + self, + pipeline_name: str, + project_id: str, + location: str = DEFAULT_DATAFLOW_LOCATION, + ) -> dict: + """ + Retrieve a new Dataflow Data Pipelines instance. + + :param pipeline_name: The display name of the pipeline. In example + projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + + Returns the created Data Pipelines instance in JSON representation. + """ + parent = self.build_parent_name(project_id, location) + service = self.get_pipelines_conn() + request = ( + service.projects() + .locations() + .pipelines() + .get( + name=f"{parent}/pipelines/{pipeline_name}", + ) + ) + response = request.execute(num_retries=self.num_retries) + return response + + @GoogleBaseHook.fallback_to_default_project_id + def run_data_pipeline( + self, + pipeline_name: str, + project_id: str, + location: str = DEFAULT_DATAFLOW_LOCATION, + ) -> dict: + """ + Run a Dataflow Data Pipeline Instance. + + :param pipeline_name: The display name of the pipeline. In example + projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + + Returns the created Job in JSON representation. + """ + parent = self.build_parent_name(project_id, location) + service = self.get_pipelines_conn() + request = ( + service.projects() + .locations() + .pipelines() + .run( + name=f"{parent}/pipelines/{pipeline_name}", + body={}, + ) + ) + response = request.execute(num_retries=self.num_retries) + return response + + @GoogleBaseHook.fallback_to_default_project_id + def delete_data_pipeline( + self, + pipeline_name: str, + project_id: str, + location: str = DEFAULT_DATAFLOW_LOCATION, + ) -> dict | None: + """ + Delete a Dataflow Data Pipelines Instance. + + :param pipeline_name: The display name of the pipeline. In example + projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + + Returns the created Job in JSON representation. + """ + parent = self.build_parent_name(project_id, location) + service = self.get_pipelines_conn() + request = ( + service.projects() + .locations() + .pipelines() + .delete( + name=f"{parent}/pipelines/{pipeline_name}", + ) + ) + response = request.execute(num_retries=self.num_retries) + return response + + @staticmethod + def build_parent_name(project_id: str, location: str): + return f"projects/{project_id}/locations/{location}" + class AsyncDataflowHook(GoogleBaseAsyncHook): """Async hook class for dataflow service.""" diff --git a/airflow/providers/google/cloud/hooks/datapipeline.py b/airflow/providers/google/cloud/hooks/datapipeline.py index 0e62562484043..0dbc2825d107c 100644 --- a/airflow/providers/google/cloud/hooks/datapipeline.py +++ b/airflow/providers/google/cloud/hooks/datapipeline.py @@ -19,40 +19,30 @@ from __future__ import annotations -from typing import Sequence +from typing import TYPE_CHECKING -from googleapiclient.discovery import build +from deprecated import deprecated -from airflow.providers.google.common.hooks.base_google import ( - GoogleBaseHook, -) - -DEFAULT_DATAPIPELINE_LOCATION = "us-central1" +from airflow.exceptions import AirflowProviderDeprecationWarning +from airflow.providers.google.cloud.hooks.dataflow import DataflowHook +from airflow.providers.google.common.hooks.base_google import GoogleBaseHook +if TYPE_CHECKING: + from googleapiclient.discovery import build -class DataPipelineHook(GoogleBaseHook): - """ - Hook for Google Data Pipelines. +DEFAULT_DATAPIPELINE_LOCATION = "us-central1" - All the methods in the hook where project_id is used must be called with - keyword arguments rather than positional. - """ - def __init__( - self, - gcp_conn_id: str = "google_cloud_default", - impersonation_chain: str | Sequence[str] | None = None, - **kwargs, - ) -> None: - super().__init__( - gcp_conn_id=gcp_conn_id, - impersonation_chain=impersonation_chain, - ) +@deprecated( + reason="This hook is deprecated and will be removed after 01.12.2024. Please use `DataflowHook`.", + category=AirflowProviderDeprecationWarning, +) +class DataPipelineHook(DataflowHook): + """Hook for Google Data Pipelines.""" def get_conn(self) -> build: """Return a Google Cloud Data Pipelines service object.""" - http_authorized = self._authorize() - return build("datapipelines", "v1", http=http_authorized, cache_discovery=False) + return super().get_pipelines_conn() @GoogleBaseHook.fallback_to_default_project_id def create_data_pipeline( @@ -60,31 +50,9 @@ def create_data_pipeline( body: dict, project_id: str, location: str = DEFAULT_DATAPIPELINE_LOCATION, - ) -> None: - """ - Create a new Data Pipelines instance from the Data Pipelines API. - - :param body: The request body (contains instance of Pipeline). See: - https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines/create#request-body - :param project_id: The ID of the GCP project that owns the job. - :param location: The location to direct the Data Pipelines instance to (for example us-central1). - - Returns the created Data Pipelines instance in JSON representation. - """ - parent = self.build_parent_name(project_id, location) - service = self.get_conn() - self.log.info(dir(service.projects().locations())) - request = ( - service.projects() - .locations() - .pipelines() - .create( - parent=parent, - body=body, - ) - ) - response = request.execute(num_retries=self.num_retries) - return response + ) -> dict: + """Create a new Data Pipelines instance from the Data Pipelines API.""" + return super().create_data_pipeline(body=body, project_id=project_id, location=location) @GoogleBaseHook.fallback_to_default_project_id def run_data_pipeline( @@ -92,30 +60,11 @@ def run_data_pipeline( data_pipeline_name: str, project_id: str, location: str = DEFAULT_DATAPIPELINE_LOCATION, - ) -> None: - """ - Run a Data Pipelines Instance using the Data Pipelines API. - - :param data_pipeline_name: The display name of the pipeline. In example - projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. - :param project_id: The ID of the GCP project that owns the job. - :param location: The location to direct the Data Pipelines instance to (for example us-central1). - - Returns the created Job in JSON representation. - """ - parent = self.build_parent_name(project_id, location) - service = self.get_conn() - request = ( - service.projects() - .locations() - .pipelines() - .run( - name=f"{parent}/pipelines/{data_pipeline_name}", - body={}, - ) + ) -> dict: + """Run a Data Pipelines Instance using the Data Pipelines API.""" + return super().run_data_pipeline( + pipeline_name=data_pipeline_name, project_id=project_id, location=location ) - response = request.execute(num_retries=self.num_retries) - return response @staticmethod def build_parent_name(project_id: str, location: str): diff --git a/airflow/providers/google/cloud/links/dataflow.py b/airflow/providers/google/cloud/links/dataflow.py index 54325ee52e0d1..26cc00f8aebe7 100644 --- a/airflow/providers/google/cloud/links/dataflow.py +++ b/airflow/providers/google/cloud/links/dataflow.py @@ -30,6 +30,9 @@ DATAFLOW_BASE_LINK = "/dataflow/jobs" DATAFLOW_JOB_LINK = DATAFLOW_BASE_LINK + "/{region}/{job_id}?project={project_id}" +DATAFLOW_PIPELINE_BASE_LINK = "/dataflow/pipelines" +DATAFLOW_PIPELINE_LINK = DATAFLOW_PIPELINE_BASE_LINK + "/{location}/{pipeline_name}?project={project_id}" + class DataflowJobLink(BaseGoogleLink): """Helper class for constructing Dataflow Job Link.""" @@ -51,3 +54,25 @@ def persist( key=DataflowJobLink.key, value={"project_id": project_id, "region": region, "job_id": job_id}, ) + + +class DataflowPipelineLink(BaseGoogleLink): + """Helper class for constructing Dataflow Pipeline Link.""" + + name = "Dataflow Pipeline" + key = "dataflow_pipeline_config" + format_str = DATAFLOW_PIPELINE_LINK + + @staticmethod + def persist( + operator_instance: BaseOperator, + context: Context, + project_id: str | None, + location: str | None, + pipeline_name: str | None, + ): + operator_instance.xcom_push( + context, + key=DataflowPipelineLink.key, + value={"project_id": project_id, "location": location, "pipeline_name": pipeline_name}, + ) diff --git a/airflow/providers/google/cloud/operators/dataflow.py b/airflow/providers/google/cloud/operators/dataflow.py index 424cb8d805c61..7b6fa5e10a665 100644 --- a/airflow/providers/google/cloud/operators/dataflow.py +++ b/airflow/providers/google/cloud/operators/dataflow.py @@ -28,6 +28,7 @@ from typing import TYPE_CHECKING, Any, Sequence from deprecated import deprecated +from googleapiclient.errors import HttpError from airflow.configuration import conf from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning @@ -38,7 +39,7 @@ process_line_and_extract_dataflow_job_id_callback, ) from airflow.providers.google.cloud.hooks.gcs import GCSHook -from airflow.providers.google.cloud.links.dataflow import DataflowJobLink +from airflow.providers.google.cloud.links.dataflow import DataflowJobLink, DataflowPipelineLink from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator from airflow.providers.google.cloud.triggers.dataflow import TemplateJobStartTrigger from airflow.providers.google.common.consts import GOOGLE_DEFAULT_DEFERRABLE_METHOD_NAME @@ -1358,3 +1359,235 @@ def execute(self, context: Context) -> None: self.log.info("No jobs to stop") return None + + +class DataflowCreatePipelineOperator(GoogleCloudBaseOperator): + """ + Creates a new Dataflow Data Pipeline instance. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:DataflowCreatePipelineOperator` + + :param body: The request body (contains instance of Pipeline). See: + https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines/create#request-body + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + :param gcp_conn_id: The connection ID to connect to the Google Cloud + Platform. + :param impersonation_chain: Optional service account to impersonate using short-term + credentials, or chained list of accounts required to get the access_token + of the last account in the list, which will be impersonated in the request. + If set as a string, the account must grant the originating account + the Service Account Token Creator IAM role. + If set as a sequence, the identities from the list must grant + Service Account Token Creator IAM role to the directly preceding identity, with first + account from the list granting this role to the originating account (templated). + + .. warning:: + This option requires Apache Beam 2.39.0 or newer. + + Returns the created Dataflow Data Pipeline instance in JSON representation. + """ + + operator_extra_links = (DataflowPipelineLink(),) + + def __init__( + self, + *, + body: dict, + project_id: str = PROVIDE_PROJECT_ID, + location: str = DEFAULT_DATAFLOW_LOCATION, + gcp_conn_id: str = "google_cloud_default", + impersonation_chain: str | Sequence[str] | None = None, + **kwargs, + ) -> None: + super().__init__(**kwargs) + + self.body = body + self.project_id = project_id + self.location = location + self.gcp_conn_id = gcp_conn_id + self.impersonation_chain = impersonation_chain + self.dataflow_hook: DataflowHook | None = None + + self.pipeline_name = self.body["name"].split("/")[-1] if self.body else None + + def execute(self, context: Context): + if self.body is None: + raise AirflowException( + "Request Body not given; cannot create a Data Pipeline without the Request Body." + ) + if self.project_id is None: + raise AirflowException( + "Project ID not given; cannot create a Data Pipeline without the Project ID." + ) + if self.location is None: + raise AirflowException("location not given; cannot create a Data Pipeline without the location.") + + self.dataflow_hook = DataflowHook( + gcp_conn_id=self.gcp_conn_id, + impersonation_chain=self.impersonation_chain, + ) + self.body["pipelineSources"] = {"airflow": "airflow"} + try: + self.pipeline = self.dataflow_hook.create_data_pipeline( + project_id=self.project_id, + body=self.body, + location=self.location, + ) + except HttpError as e: + if e.resp.status == 409: + # If the pipeline already exists, retrieve it + self.log.info("Pipeline with given name already exists.") + self.pipeline = self.dataflow_hook.get_data_pipeline( + project_id=self.project_id, + pipeline_name=self.pipeline_name, + location=self.location, + ) + DataflowPipelineLink.persist(self, context, self.project_id, self.location, self.pipeline_name) + self.xcom_push(context, key="pipeline_name", value=self.pipeline_name) + if self.pipeline: + if "error" in self.pipeline: + raise AirflowException(self.pipeline.get("error").get("message")) + + return self.pipeline + + +class DataflowRunPipelineOperator(GoogleCloudBaseOperator): + """ + Runs a Dataflow Data Pipeline. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:DataflowRunPipelineOperator` + + :param pipeline_name: The display name of the pipeline. In example + projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + :param gcp_conn_id: The connection ID to connect to the Google Cloud Platform. + :param impersonation_chain: Optional service account to impersonate using short-term + credentials, or chained list of accounts required to get the access_token + of the last account in the list, which will be impersonated in the request. + If set as a string, the account must grant the originating account + the Service Account Token Creator IAM role. + If set as a sequence, the identities from the list must grant + Service Account Token Creator IAM role to the directly preceding identity, with first + account from the list granting this role to the originating account (templated). + + Returns the created Job in JSON representation. + """ + + operator_extra_links = (DataflowJobLink(),) + + def __init__( + self, + pipeline_name: str, + project_id: str = PROVIDE_PROJECT_ID, + location: str = DEFAULT_DATAFLOW_LOCATION, + gcp_conn_id: str = "google_cloud_default", + impersonation_chain: str | Sequence[str] | None = None, + **kwargs, + ) -> None: + super().__init__(**kwargs) + + self.pipeline_name = pipeline_name + self.project_id = project_id + self.location = location + self.gcp_conn_id = gcp_conn_id + self.impersonation_chain = impersonation_chain + self.dataflow_hook: DataflowHook | None = None + + def execute(self, context: Context): + self.dataflow_hook = DataflowHook( + gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain + ) + + if self.pipeline_name is None: + raise AirflowException("Data Pipeline name not given; cannot run unspecified pipeline.") + if self.project_id is None: + raise AirflowException("Data Pipeline Project ID not given; cannot run pipeline.") + if self.location is None: + raise AirflowException("Data Pipeline location not given; cannot run pipeline.") + try: + self.job = self.dataflow_hook.run_data_pipeline( + pipeline_name=self.pipeline_name, + project_id=self.project_id, + location=self.location, + )["job"] + job_id = self.dataflow_hook.extract_job_id(self.job) + self.xcom_push(context, key="job_id", value=job_id) + DataflowJobLink.persist(self, context, self.project_id, self.location, job_id) + except HttpError as e: + if e.resp.status == 404: + raise AirflowException("Pipeline with given name was not found.") + except Exception as exc: + raise AirflowException("Error occurred when running Pipeline: %s", exc) + + return self.job + + +class DataflowDeletePipelineOperator(GoogleCloudBaseOperator): + """ + Deletes a Dataflow Data Pipeline. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:DataflowDeletePipelineOperator` + + :param pipeline_name: The display name of the pipeline. In example + projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. + :param project_id: The ID of the GCP project that owns the job. + :param location: The location to direct the Data Pipelines instance to (for example us-central1). + :param gcp_conn_id: The connection ID to connect to the Google Cloud Platform. + :param impersonation_chain: Optional service account to impersonate using short-term + credentials, or chained list of accounts required to get the access_token + of the last account in the list, which will be impersonated in the request. + If set as a string, the account must grant the originating account + the Service Account Token Creator IAM role. + If set as a sequence, the identities from the list must grant + Service Account Token Creator IAM role to the directly preceding identity, with first + account from the list granting this role to the originating account (templated). + """ + + def __init__( + self, + pipeline_name: str, + project_id: str = PROVIDE_PROJECT_ID, + location: str = DEFAULT_DATAFLOW_LOCATION, + gcp_conn_id: str = "google_cloud_default", + impersonation_chain: str | Sequence[str] | None = None, + **kwargs, + ) -> None: + super().__init__(**kwargs) + + self.pipeline_name = pipeline_name + self.project_id = project_id + self.location = location + self.gcp_conn_id = gcp_conn_id + self.impersonation_chain = impersonation_chain + self.dataflow_hook: DataflowHook | None = None + + def execute(self, context: Context): + self.dataflow_hook = DataflowHook( + gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain + ) + + if self.pipeline_name is None: + raise AirflowException("Data Pipeline name not given; cannot run unspecified pipeline.") + if self.project_id is None: + raise AirflowException("Data Pipeline Project ID not given; cannot run pipeline.") + if self.location is None: + raise AirflowException("Data Pipeline location not given; cannot run pipeline.") + + self.response = self.dataflow_hook.delete_data_pipeline( + pipeline_name=self.pipeline_name, + project_id=self.project_id, + location=self.location, + ) + + if self.response: + raise AirflowException(self.response.get("error").get("message")) + + return None diff --git a/airflow/providers/google/cloud/operators/datapipeline.py b/airflow/providers/google/cloud/operators/datapipeline.py index a864d8794c696..ebe92f648ab28 100644 --- a/airflow/providers/google/cloud/operators/datapipeline.py +++ b/airflow/providers/google/cloud/operators/datapipeline.py @@ -19,138 +19,46 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Sequence - -from airflow.exceptions import AirflowException -from airflow.providers.google.cloud.hooks.datapipeline import DEFAULT_DATAPIPELINE_LOCATION, DataPipelineHook -from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator +from deprecated import deprecated + +from airflow.exceptions import AirflowProviderDeprecationWarning +from airflow.providers.google.cloud.hooks.dataflow import DEFAULT_DATAFLOW_LOCATION +from airflow.providers.google.cloud.operators.dataflow import ( + DataflowCreatePipelineOperator, + DataflowRunPipelineOperator, +) from airflow.providers.google.common.hooks.base_google import PROVIDE_PROJECT_ID -if TYPE_CHECKING: - from airflow.utils.context import Context - -class CreateDataPipelineOperator(GoogleCloudBaseOperator): - """ - Creates a new Data Pipelines instance from the Data Pipelines API. +@deprecated( + reason="This operator is deprecated and will be removed after 01.12.2024. " + "Please use `DataflowCreatePipelineOperator`.", + category=AirflowProviderDeprecationWarning, +) +class CreateDataPipelineOperator(DataflowCreatePipelineOperator): + """Creates a new Data Pipelines instance from the Data Pipelines API.""" - :param body: The request body (contains instance of Pipeline). See: - https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines/create#request-body - :param project_id: The ID of the GCP project that owns the job. - :param location: The location to direct the Data Pipelines instance to (for example us-central1). - :param gcp_conn_id: The connection ID to connect to the Google Cloud - Platform. - :param impersonation_chain: Optional service account to impersonate using short-term - credentials, or chained list of accounts required to get the access_token - of the last account in the list, which will be impersonated in the request. - If set as a string, the account must grant the originating account - the Service Account Token Creator IAM role. - If set as a sequence, the identities from the list must grant - Service Account Token Creator IAM role to the directly preceding identity, with first - account from the list granting this role to the originating account (templated). - .. warning:: - This option requires Apache Beam 2.39.0 or newer. - - Returns the created Data Pipelines instance in JSON representation. - """ - - def __init__( - self, - *, - body: dict, - project_id: str = PROVIDE_PROJECT_ID, - location: str = DEFAULT_DATAPIPELINE_LOCATION, - gcp_conn_id: str = "google_cloud_default", - impersonation_chain: str | Sequence[str] | None = None, - **kwargs, - ) -> None: - super().__init__(**kwargs) - - self.body = body - self.project_id = project_id - self.location = location - self.gcp_conn_id = gcp_conn_id - self.impersonation_chain = impersonation_chain - self.datapipeline_hook: DataPipelineHook | None = None - self.body["pipelineSources"] = {"airflow": "airflow"} - - def execute(self, context: Context): - if self.body is None: - raise AirflowException( - "Request Body not given; cannot create a Data Pipeline without the Request Body." - ) - if self.project_id is None: - raise AirflowException( - "Project ID not given; cannot create a Data Pipeline without the Project ID." - ) - if self.location is None: - raise AirflowException("location not given; cannot create a Data Pipeline without the location.") - - self.datapipeline_hook = DataPipelineHook( - gcp_conn_id=self.gcp_conn_id, - impersonation_chain=self.impersonation_chain, - ) - - self.data_pipeline = self.datapipeline_hook.create_data_pipeline( - project_id=self.project_id, - body=self.body, - location=self.location, - ) - if self.data_pipeline: - if "error" in self.data_pipeline: - raise AirflowException(self.data_pipeline.get("error").get("message")) - - return self.data_pipeline - - -class RunDataPipelineOperator(GoogleCloudBaseOperator): - """ - Runs a Data Pipelines Instance using the Data Pipelines API. - - :param data_pipeline_name: The display name of the pipeline. In example - projects/PROJECT_ID/locations/LOCATION_ID/pipelines/PIPELINE_ID it would be the PIPELINE_ID. - :param project_id: The ID of the GCP project that owns the job. - :param location: The location to direct the Data Pipelines instance to (for example us-central1). - :param gcp_conn_id: The connection ID to connect to the Google Cloud - Platform. - - Returns the created Job in JSON representation. - """ +@deprecated( + reason="This operator is deprecated and will be removed after 01.12.2024. " + "Please use `DataflowRunPipelineOperator`.", + category=AirflowProviderDeprecationWarning, +) +class RunDataPipelineOperator(DataflowRunPipelineOperator): + """Runs a Data Pipelines Instance using the Data Pipelines API.""" def __init__( self, data_pipeline_name: str, project_id: str = PROVIDE_PROJECT_ID, - location: str = DEFAULT_DATAPIPELINE_LOCATION, + location: str = DEFAULT_DATAFLOW_LOCATION, gcp_conn_id: str = "google_cloud_default", **kwargs, ) -> None: - super().__init__(**kwargs) - - self.data_pipeline_name = data_pipeline_name - self.project_id = project_id - self.location = location - self.gcp_conn_id = gcp_conn_id - - def execute(self, context: Context): - self.data_pipeline_hook = DataPipelineHook(gcp_conn_id=self.gcp_conn_id) - - if self.data_pipeline_name is None: - raise AirflowException("Data Pipeline name not given; cannot run unspecified pipeline.") - if self.project_id is None: - raise AirflowException("Data Pipeline Project ID not given; cannot run pipeline.") - if self.location is None: - raise AirflowException("Data Pipeline location not given; cannot run pipeline.") - - self.response = self.data_pipeline_hook.run_data_pipeline( - data_pipeline_name=self.data_pipeline_name, - project_id=self.project_id, - location=self.location, + super().__init__( + pipeline_name=data_pipeline_name, + project_id=project_id, + location=location, + gcp_conn_id=gcp_conn_id, + **kwargs, ) - - if self.response: - if "error" in self.response: - raise AirflowException(self.response.get("error").get("message")) - - return self.response diff --git a/airflow/providers/google/provider.yaml b/airflow/providers/google/provider.yaml index d5a656a29b401..0b62b1f21f6fd 100644 --- a/airflow/providers/google/provider.yaml +++ b/airflow/providers/google/provider.yaml @@ -1221,6 +1221,7 @@ extra-links: - airflow.providers.google.cloud.operators.cloud_composer.CloudComposerEnvironmentLink - airflow.providers.google.cloud.operators.cloud_composer.CloudComposerEnvironmentsLink - airflow.providers.google.cloud.links.dataflow.DataflowJobLink + - airflow.providers.google.cloud.links.dataflow.DataflowPipelineLink - airflow.providers.google.cloud.links.datastore.CloudDatastoreImportExportLink - airflow.providers.google.cloud.links.datastore.CloudDatastoreEntitiesLink - airflow.providers.google.cloud.links.bigtable.BigtableInstanceLink diff --git a/docs/apache-airflow-providers-google/operators/cloud/dataflow.rst b/docs/apache-airflow-providers-google/operators/cloud/dataflow.rst index f9302af8c3cde..71fc3275fe99f 100644 --- a/docs/apache-airflow-providers-google/operators/cloud/dataflow.rst +++ b/docs/apache-airflow-providers-google/operators/cloud/dataflow.rst @@ -39,6 +39,10 @@ There are several ways to run a Dataflow pipeline depending on your environment, This is the fastest way to start a pipeline, but because of its frequent problems with system dependencies, it may cause problems. See: :ref:`howto/operator:DataflowCreateJavaJobOperator`, :ref:`howto/operator:DataflowCreatePythonJobOperator` for more detailed information. + Developer can also create a pipeline by passing its structure in a JSON format and then run it to create + a Job. + See: :ref:`howto/operator:DataflowCreatePipelineOperator` and :ref:`howto/operator:DataflowRunPipelineOperator` + for more detailed information. - **Templated pipeline**: The programmer can make the pipeline independent of the environment by preparing a template that will then be run on a machine managed by Google. This way, changes to the environment won't affect your pipeline. There are two types of the templates: @@ -63,6 +67,40 @@ in the Google Cloud documentation. Starting Non-templated pipeline ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. _howto/operator:DataflowCreatePipelineOperator: +.. _howto/operator:DataflowRunPipelineOperator: + +JSON-formatted pipelines +"""""""""""""""""""""""" +A new pipeline can be created by passing its structure in a JSON format. See +:class:`~airflow.providers.google.cloud.operators.dataflow.DataflowCreatePipelineOperator` +This will create a new pipeline that will be visible on Dataflow Pipelines UI. + +Here is an example of how you can create a Dataflow Pipeline by running DataflowCreatePipelineOperator: + +.. exampleinclude:: /../../tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py + :language: python + :dedent: 4 + :start-after: [START howto_operator_create_dataflow_pipeline] + :end-before: [END howto_operator_create_dataflow_pipeline] + +To run a newly created pipeline you can use +:class:`~airflow.providers.google.cloud.operators.dataflow.DataflowRunPipelineOperator` + +.. exampleinclude:: /../../tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py + :language: python + :dedent: 4 + :start-after: [START howto_operator_run_dataflow_pipeline] + :end-before: [END howto_operator_run_dataflow_pipeline] + +Once called, the DataflowRunPipelineOperator will return the Google Cloud +`Dataflow Job `__ +created by running the given pipeline. + +For further information regarding the API usage, see +`Data Pipelines API REST Resource `__ +in the Google Cloud documentation. + To create a new pipeline using the source file (JAR in Java or Python file) use the create job operators. The source file can be located on GCS or on the local filesystem. :class:`~airflow.providers.apache.beam.operators.beam.BeamRunJavaPipelineOperator` @@ -286,6 +324,20 @@ Provide ``job_id`` to stop a specific job, or ``job_name_prefix`` to stop all jo See: `Stopping a running pipeline `_. +.. _howto/operator:DataflowDeletePipelineOperator: + +Deleting a pipeline +^^^^^^^^^^^^^^^^^^^ +To delete a Dataflow pipeline you can use +:class:`~airflow.providers.google.cloud.operators.dataflow.DataflowDeletePipelineOperator`. +Here is an example how you can use this operator: + +.. exampleinclude:: /../../tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py + :language: python + :dedent: 4 + :start-after: [START howto_operator_delete_dataflow_pipeline] + :end-before: [END howto_operator_delete_dataflow_pipeline] + .. _howto/operator:DataflowJobStatusSensor: .. _howto/operator:DataflowJobMetricsSensor: .. _howto/operator:DataflowJobMessagesSensor: diff --git a/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst b/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst index 4096aa7c9b037..10186138edb25 100644 --- a/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst +++ b/docs/apache-airflow-providers-google/operators/cloud/datapipeline.rst @@ -33,6 +33,8 @@ Prerequisite Tasks Creating a Data Pipeline ^^^^^^^^^^^^^^^^^^^^^^^^ +This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowCreatePipelineOperator`. + To create a new Data Pipelines instance using a request body and parent name, use :class:`~airflow.providers.google.cloud.operators.datapipeline.CreateDataPipelineOperator`. The operator accesses Google Cloud's Data Pipelines API and calls upon the `create method `__ @@ -58,6 +60,8 @@ Here is an example of how you can create a Data Pipelines instance by running th Running a Data Pipeline ^^^^^^^^^^^^^^^^^^^^^^^ +This operator is deprecated. Please use :class:`~airflow.providers.google.cloud.operators.dataflow.DataflowRunPipelineOperator`. + To run a Data Pipelines instance, use :class:`~airflow.providers.google.cloud.operators.datapipeline.RunDataPipelineOperator`. The operator accesses Google Cloud's Data Pipelines API and calls upon the `run method `__ diff --git a/tests/always/test_project_structure.py b/tests/always/test_project_structure.py index ba4a467351532..d344ee4995231 100644 --- a/tests/always/test_project_structure.py +++ b/tests/always/test_project_structure.py @@ -365,6 +365,8 @@ class TestGoogleProviderProjectStructure(ExampleCoverageTest, AssetsCoverageTest ".CloudDataTransferServiceGCSToGCSOperator", "airflow.providers.google.cloud.operators.automl.AutoMLTablesUpdateDatasetOperator", "airflow.providers.google.cloud.operators.automl.AutoMLDeployModelOperator", + "airflow.providers.google.cloud.operators.datapipeline.CreateDataPipelineOperator", + "airflow.providers.google.cloud.operators.datapipeline.RunDataPipelineOperator", "airflow.providers.google.cloud.operators.dataproc.DataprocSubmitHadoopJobOperator", "airflow.providers.google.cloud.operators.dataproc.DataprocScaleClusterOperator", "airflow.providers.google.cloud.operators.dataproc.DataprocSubmitSparkJobOperator", diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml index d6400074e6567..0bde758f0f3bc 100644 --- a/tests/deprecations_ignore.yml +++ b/tests/deprecations_ignore.yml @@ -395,6 +395,9 @@ - tests/providers/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_query_with_arg - tests/providers/google/cloud/hooks/test_bigquery.py::TestTimePartitioningInRunJob::test_run_with_auto_detect - tests/providers/google/cloud/hooks/test_cloud_sql.py::TestCloudSqlDatabaseHook::test_cloudsql_database_hook_get_database_hook +- tests/providers/google/cloud/hooks/test_datapipeline.py::TestDataPipelineHook::test_get_conn +- tests/providers/google/cloud/hooks/test_datapipeline.py::TestDataPipelineHook::test_create_data_pipeline +- tests/providers/google/cloud/hooks/test_datapipeline.py::TestDataPipelineHook::test_run_data_pipeline - tests/providers/google/cloud/hooks/test_gcs.py::TestGCSHook::test_list__error_match_glob_and_invalid_delimiter - tests/providers/google/cloud/hooks/test_kubernetes_engine.py::TestGKECustomResourceHook::test_get_connection_update_hook_with_invalid_token - tests/providers/google/cloud/hooks/test_kubernetes_engine.py::TestGKECustomResourceHook::test_get_connection_update_hook_with_valid_token @@ -456,6 +459,8 @@ - tests/providers/google/cloud/operators/test_dataflow.py::TestDataflowCreateJavaJobOperatorWithLocal::test_init - tests/providers/google/cloud/operators/test_dataflow.py::TestDataflowCreatePythonJobOperator::test_exec - tests/providers/google/cloud/operators/test_dataflow.py::TestDataflowCreatePythonJobOperator::test_init +- tests/providers/google/cloud/operators/test_datapipeline.py::TestCreateDataPipelineOperator::test_execute +- tests/providers/google/cloud/operators/test_datapipeline.py::TestRunDataPipelineOperator::test_execute - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHadoopOperator::test_execute - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_builder - tests/providers/google/cloud/operators/test_dataproc.py::TestDataProcHiveOperator::test_execute diff --git a/tests/providers/google/cloud/hooks/test_dataflow.py b/tests/providers/google/cloud/hooks/test_dataflow.py index 1c8f768ea3aa2..d976580b28164 100644 --- a/tests/providers/google/cloud/hooks/test_dataflow.py +++ b/tests/providers/google/cloud/hooks/test_dataflow.py @@ -129,6 +129,28 @@ """ TEST_SQL_JOB_ID = "test-job-id" +TEST_PIPELINE_PARENT = f"projects/{TEST_PROJECT}/locations/{TEST_LOCATION}" +TEST_PIPELINE_NAME = "test-data-pipeline-name" +TEST_PIPELINE_BODY = { + "name": f"{TEST_PIPELINE_PARENT}/pipelines/{TEST_PIPELINE_NAME}", + "type": "PIPELINE_TYPE_BATCH", + "workload": { + "dataflowFlexTemplateRequest": { + "launchParameter": { + "containerSpecGcsPath": "gs://dataflow-templates-us-central1/latest/Word_Count_metadata", + "jobName": "test-job", + "environment": {"tempLocation": "test-temp-location"}, + "parameters": { + "inputFile": "gs://dataflow-samples/shakespeare/kinglear.txt", + "output": "gs://test/output/my_output", + }, + }, + "projectId": f"{TEST_PROJECT}", + "location": f"{TEST_LOCATION}", + } + }, +} + DEFAULT_CANCEL_TIMEOUT = 5 * 60 @@ -1854,6 +1876,126 @@ def test_fetch_job_autoscaling_events_by_id(self, mock_fetch_responses): assert result == ["event_1", "event_2"] +@pytest.mark.db_test +class TestDataflowPipelineHook: + def setup_method(self): + self.dataflow_hook = DataflowHook(gcp_conn_id="google_cloud_default") + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook._authorize") + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.build") + def test_get_conn(self, mock_build, mock_authorize): + """ + Test that get_conn is called with the correct params and + returns the correct API address + """ + connection = self.dataflow_hook.get_pipelines_conn() + mock_build.assert_called_once_with( + "datapipelines", "v1", http=mock_authorize.return_value, cache_discovery=False + ) + assert mock_build.return_value == connection + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.build_parent_name") + def test_build_parent_name(self, mock_build_parent_name): + """ + Test that build_parent_name is called with the correct params and + returns the correct parent string + """ + result = self.dataflow_hook.build_parent_name( + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + mock_build_parent_name.assert_called_with( + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + assert mock_build_parent_name.return_value == result + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") + def test_create_data_pipeline(self, mock_connection): + """ + Test that request are called with the correct params + Test that request returns the correct value + """ + mock_locations = mock_connection.return_value.projects.return_value.locations + mock_request = mock_locations.return_value.pipelines.return_value.create + mock_request.return_value.execute.return_value = TEST_PIPELINE_BODY + + result = self.dataflow_hook.create_data_pipeline( + body=TEST_PIPELINE_BODY, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + mock_request.assert_called_once_with( + parent=TEST_PIPELINE_PARENT, + body=TEST_PIPELINE_BODY, + ) + assert result == TEST_PIPELINE_BODY + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") + def test_run_data_pipeline(self, mock_connection): + """ + Test that run_data_pipeline is called with correct parameters and + calls Google Data Pipelines API + """ + mock_request = mock_connection.return_value.projects.return_value.locations.return_value.pipelines.return_value.run + mock_request.return_value.execute.return_value = {"job": {"id": TEST_JOB_ID}} + + result = self.dataflow_hook.run_data_pipeline( + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + mock_request.assert_called_once_with( + name=f"{TEST_PIPELINE_PARENT}/pipelines/{TEST_PIPELINE_NAME}", + body={}, + ) + assert result == {"job": {"id": TEST_JOB_ID}} + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") + def test_get_data_pipeline(self, mock_connection): + """ + Test that get_data_pipeline is called with correct parameters and + calls Google Data Pipelines API + """ + mock_locations = mock_connection.return_value.projects.return_value.locations + mock_request = mock_locations.return_value.pipelines.return_value.get + mock_request.return_value.execute.return_value = TEST_PIPELINE_BODY + + result = self.dataflow_hook.get_data_pipeline( + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + mock_request.assert_called_once_with( + name=f"{TEST_PIPELINE_PARENT}/pipelines/{TEST_PIPELINE_NAME}", + ) + assert result == TEST_PIPELINE_BODY + + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") + def test_delete_data_pipeline(self, mock_connection): + """ + Test that delete_data_pipeline is called with correct parameters and + calls Google Data Pipelines API + """ + mock_locations = mock_connection.return_value.projects.return_value.locations + mock_request = mock_locations.return_value.pipelines.return_value.delete + mock_request.return_value.execute.return_value = None + + result = self.dataflow_hook.delete_data_pipeline( + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + mock_request.assert_called_once_with( + name=f"{TEST_PIPELINE_PARENT}/pipelines/{TEST_PIPELINE_NAME}", + ) + assert result is None + + APACHE_BEAM_V_2_14_0_JAVA_SDK_LOG = f""""\ Dataflow SDK version: 2.14.0 Jun 15, 2020 2:57:28 PM org.apache.beam.runners.dataflow.DataflowRunner run diff --git a/tests/providers/google/cloud/hooks/test_datapipeline.py b/tests/providers/google/cloud/hooks/test_datapipeline.py index 4bac7e7847d52..589731719ad0b 100644 --- a/tests/providers/google/cloud/hooks/test_datapipeline.py +++ b/tests/providers/google/cloud/hooks/test_datapipeline.py @@ -27,9 +27,13 @@ TASK_ID = "test-datapipeline-operators" -TEST_NAME = "projects/test-project-id/locations/test-location" +TEST_PARENT_NAME = "projects/test-project-id/locations/test-location" +TEST_LOCATION = "test-location" +TEST_PROJECT_ID = "test-project-id" +TEST_DATA_PIPELINE_NAME = "test-data-pipeline-name" +TEST_JOB_ID = "test-job-id" TEST_BODY = { - "name": "projects/test-project-id/locations/test-location/pipelines/test-pipeline", + "name": f"{TEST_PARENT_NAME}/pipelines/{TEST_DATA_PIPELINE_NAME}", "type": "PIPELINE_TYPE_BATCH", "workload": { "dataflowFlexTemplateRequest": { @@ -42,17 +46,11 @@ "output": "gs://test/output/my_output", }, }, - "projectId": "test-project-id", - "location": "test-location", + "projectId": TEST_PROJECT_ID, + "location": TEST_LOCATION, } }, } -TEST_LOCATION = "test-location" -TEST_PROJECTID = "test-project-id" -TEST_DATA_PIPELINE_NAME = "test-data-pipeline-name" -TEST_PARENT = "projects/test-project-id/locations/test-location" -TEST_JOB_ID = "test-job-id" -TEST_NAME = "projects/test-project-id/locations/test-location/pipelines/test-data-pipeline-name" class TestDataPipelineHook: @@ -63,8 +61,8 @@ class TestDataPipelineHook: def setup_method(self): self.datapipeline_hook = DataPipelineHook(gcp_conn_id="google_cloud_default") - @mock.patch("airflow.providers.google.cloud.hooks.datapipeline.DataPipelineHook._authorize") - @mock.patch("airflow.providers.google.cloud.hooks.datapipeline.build") + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook._authorize") + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.build") def test_get_conn(self, mock_build, mock_authorize): """ Test that get_conn is called with the correct params and @@ -76,23 +74,7 @@ def test_get_conn(self, mock_build, mock_authorize): ) assert mock_build.return_value == connection - @mock.patch("airflow.providers.google.cloud.hooks.datapipeline.DataPipelineHook.build_parent_name") - def test_build_parent_name(self, mock_build_parent_name): - """ - Test that build_parent_name is called with the correct params and - returns the correct parent string - """ - result = self.datapipeline_hook.build_parent_name( - project_id=TEST_PROJECTID, - location=TEST_LOCATION, - ) - mock_build_parent_name.assert_called_with( - project_id=TEST_PROJECTID, - location=TEST_LOCATION, - ) - assert mock_build_parent_name.return_value == result - - @mock.patch("airflow.providers.google.cloud.hooks.datapipeline.DataPipelineHook.get_conn") + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") def test_create_data_pipeline(self, mock_connection): """ Test that request are called with the correct params @@ -100,21 +82,21 @@ def test_create_data_pipeline(self, mock_connection): """ mock_locations = mock_connection.return_value.projects.return_value.locations mock_request = mock_locations.return_value.pipelines.return_value.create - mock_request.return_value.execute.return_value = {"name": TEST_PARENT} + mock_request.return_value.execute.return_value = {"name": TEST_PARENT_NAME} result = self.datapipeline_hook.create_data_pipeline( body=TEST_BODY, - project_id=TEST_PROJECTID, + project_id=TEST_PROJECT_ID, location=TEST_LOCATION, ) mock_request.assert_called_once_with( - parent=TEST_PARENT, + parent=TEST_PARENT_NAME, body=TEST_BODY, ) - assert result == {"name": TEST_PARENT} + assert result == {"name": TEST_PARENT_NAME} - @mock.patch("airflow.providers.google.cloud.hooks.datapipeline.DataPipelineHook.get_conn") + @mock.patch("airflow.providers.google.cloud.hooks.dataflow.DataflowHook.get_pipelines_conn") def test_run_data_pipeline(self, mock_connection): """ Test that run_data_pipeline is called with correct parameters and @@ -125,12 +107,12 @@ def test_run_data_pipeline(self, mock_connection): result = self.datapipeline_hook.run_data_pipeline( data_pipeline_name=TEST_DATA_PIPELINE_NAME, - project_id=TEST_PROJECTID, + project_id=TEST_PROJECT_ID, location=TEST_LOCATION, ) mock_request.assert_called_once_with( - name=TEST_NAME, + name=f"{TEST_PARENT_NAME}/pipelines/{TEST_DATA_PIPELINE_NAME}", body={}, ) assert result == {"job": {"id": TEST_JOB_ID}} diff --git a/tests/providers/google/cloud/operators/test_dataflow.py b/tests/providers/google/cloud/operators/test_dataflow.py index ebbf471383760..7b8aeaf3fd5e5 100644 --- a/tests/providers/google/cloud/operators/test_dataflow.py +++ b/tests/providers/google/cloud/operators/test_dataflow.py @@ -21,9 +21,12 @@ from copy import deepcopy from unittest import mock +import httplib2 import pytest +from googleapiclient.errors import HttpError import airflow +from airflow.exceptions import AirflowException from airflow.providers.google.cloud.hooks.dataflow import ( DEFAULT_DATAFLOW_LOCATION, DataflowJobStatus, @@ -31,7 +34,10 @@ from airflow.providers.google.cloud.operators.dataflow import ( CheckJobRunning, DataflowCreateJavaJobOperator, + DataflowCreatePipelineOperator, DataflowCreatePythonJobOperator, + DataflowDeletePipelineOperator, + DataflowRunPipelineOperator, DataflowStartFlexTemplateOperator, DataflowStartSqlJobOperator, DataflowStopJobOperator, @@ -104,6 +110,27 @@ CANCEL_TIMEOUT = 10 * 420 DATAFLOW_PATH = "airflow.providers.google.cloud.operators.dataflow" +TEST_PIPELINE_NAME = "test_data_pipeline_name" +TEST_PIPELINE_BODY = { + "name": f"projects/test-datapipeline-operators/locations/test-location/pipelines/{TEST_PIPELINE_NAME}", + "type": "PIPELINE_TYPE_BATCH", + "workload": { + "dataflowFlexTemplateRequest": { + "launchParameter": { + "containerSpecGcsPath": "gs://dataflow-templates-us-central1/latest/Word_Count_metadata", + "jobName": "test-job", + "environment": {"tempLocation": "test-temp-location"}, + "parameters": { + "inputFile": "gs://dataflow-samples/shakespeare/kinglear.txt", + "output": "gs://test/output/my_output", + }, + }, + "projectId": f"{TEST_PROJECT}", + "location": f"{TEST_LOCATION}", + } + }, +} + class TestDataflowCreatePythonJobOperator: def setup_method(self): @@ -758,3 +785,310 @@ def test_exec_job_name_prefix(self, dataflow_mock): location=TEST_LOCATION, job_id=None, ) + + +class TestDataflowCreatePipelineOperator: + @pytest.fixture + def create_operator(self): + """ + Creates a mock create datapipeline operator to be used in testing. + """ + return DataflowCreatePipelineOperator( + task_id="test_create_datapipeline", + body=TEST_PIPELINE_BODY, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + gcp_conn_id=GCP_CONN_ID, + ) + + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") + def test_execute(self, mock_hook, create_operator): + """ + Test that operator creates and calls the Dataflow Data Pipeline hook with the correct parameters + """ + create_operator.execute(mock.MagicMock()) + mock_hook.assert_called_once_with( + gcp_conn_id="test_gcp_conn_id", + impersonation_chain=None, + ) + + mock_hook.return_value.create_data_pipeline.assert_called_once_with( + project_id=TEST_PROJECT, body=TEST_PIPELINE_BODY, location=TEST_LOCATION + ) + + @pytest.mark.db_test + def test_body_invalid(self): + """ + Test that if the operator is not passed a Request Body, an AirflowException is raised + """ + init_kwargs = { + "task_id": "test_create_datapipeline", + "body": {}, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowCreatePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_projectid_invalid(self): + """ + Test that if the operator is not passed a Project ID, an AirflowException is raised + """ + init_kwargs = { + "task_id": "test_create_datapipeline", + "body": TEST_PIPELINE_BODY, + "project_id": None, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowCreatePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_location_invalid(self): + """ + Test that if the operator is not passed a location, an AirflowException is raised + """ + init_kwargs = { + "task_id": "test_create_datapipeline", + "body": TEST_PIPELINE_BODY, + "project_id": TEST_PROJECT, + "location": None, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowCreatePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + @pytest.mark.db_test + def test_response_invalid(self): + """ + Test that if the Response Body contains an error message, an AirflowException is raised + """ + init_kwargs = { + "task_id": "test_create_datapipeline", + "body": {"name": TEST_PIPELINE_NAME, "error": "Testing that AirflowException is raised"}, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowCreatePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + @pytest.mark.db_test + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") + def test_response_409(self, mock_hook, create_operator): + """ + Test that if the Pipeline already exists, the operator does not fail and retrieves existed Pipeline + """ + mock_hook.return_value.create_data_pipeline.side_effect = HttpError( + resp=httplib2.Response({"status": "409"}), content=b"content" + ) + create_operator.execute(mock.MagicMock()) + mock_hook.assert_called_once_with( + gcp_conn_id="test_gcp_conn_id", + impersonation_chain=None, + ) + + mock_hook.return_value.get_data_pipeline.assert_called_once_with( + project_id=TEST_PROJECT, pipeline_name=TEST_PIPELINE_NAME, location=TEST_LOCATION + ) + + +@pytest.mark.db_test +class TestDataflowRunPipelineOperator: + @pytest.fixture + def run_operator(self): + """ + Create a DataflowRunPipelineOperator instance with test data + """ + return DataflowRunPipelineOperator( + task_id=TASK_ID, + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + gcp_conn_id=GCP_CONN_ID, + ) + + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") + def test_execute(self, data_pipeline_hook_mock, run_operator): + """ + Test Run Operator execute with correct parameters + """ + run_operator.execute(mock.MagicMock()) + data_pipeline_hook_mock.assert_called_once_with( + gcp_conn_id=GCP_CONN_ID, + impersonation_chain=None, + ) + + data_pipeline_hook_mock.return_value.run_data_pipeline.assert_called_once_with( + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + def test_invalid_data_pipeline_name(self): + """ + Test that AirflowException is raised if Run Operator is not given a data pipeline name. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": None, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowRunPipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_project_id(self): + """ + Test that AirflowException is raised if Run Operator is not given a project ID. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": TEST_PIPELINE_NAME, + "project_id": None, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowRunPipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_location(self): + """ + Test that AirflowException is raised if Run Operator is not given a location. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": TEST_PIPELINE_NAME, + "project_id": TEST_PROJECT, + "location": None, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowRunPipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_response(self): + """ + Test that AirflowException is raised if Run Operator fails execution and returns error. + """ + init_kwargs = { + "task_id": TASK_ID, + "data_pipeline_name": TEST_PIPELINE_NAME, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowRunPipelineOperator(**init_kwargs).execute(mock.MagicMock()).return_value = { + "error": {"message": "example error"} + } + + @pytest.mark.db_test + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") + def test_response_404(self, mock_hook, run_operator): + """ + Test that if the Pipeline does not exist, the operator raise AirflowException + """ + mock_hook.return_value.run_data_pipeline.side_effect = HttpError( + resp=httplib2.Response({"status": "404"}), content=b"content" + ) + with pytest.raises(AirflowException): + run_operator.execute(mock.MagicMock()) + mock_hook.assert_called_once_with( + gcp_conn_id="test_gcp_conn_id", + impersonation_chain=None, + ) + + +@pytest.mark.db_test +class TestDataflowDeletePipelineOperator: + @pytest.fixture + def run_operator(self): + """ + Create a DataflowDeletePipelineOperator instance with test data + """ + return DataflowDeletePipelineOperator( + task_id=TASK_ID, + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + gcp_conn_id=GCP_CONN_ID, + ) + + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") + # @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook.delete_data_pipeline") + def test_execute(self, data_pipeline_hook_mock, run_operator): + """ + Test Delete Operator execute with correct parameters + """ + data_pipeline_hook_mock.return_value.delete_data_pipeline.return_value = None + run_operator.execute(mock.MagicMock()) + data_pipeline_hook_mock.assert_called_once_with( + gcp_conn_id=GCP_CONN_ID, + impersonation_chain=None, + ) + + data_pipeline_hook_mock.return_value.delete_data_pipeline.assert_called_once_with( + pipeline_name=TEST_PIPELINE_NAME, + project_id=TEST_PROJECT, + location=TEST_LOCATION, + ) + + def test_invalid_data_pipeline_name(self): + """ + Test that AirflowException is raised if Delete Operator is not given a data pipeline name. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": None, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowDeletePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_project_id(self): + """ + Test that AirflowException is raised if Delete Operator is not given a project ID. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": TEST_PIPELINE_NAME, + "project_id": None, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowDeletePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_location(self): + """ + Test that AirflowException is raised if Delete Operator is not given a location. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": TEST_PIPELINE_NAME, + "project_id": TEST_PROJECT, + "location": None, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowDeletePipelineOperator(**init_kwargs).execute(mock.MagicMock()) + + def test_invalid_response(self): + """ + Test that AirflowException is raised if Delete Operator fails execution and returns error. + """ + init_kwargs = { + "task_id": TASK_ID, + "pipeline_name": TEST_PIPELINE_NAME, + "project_id": TEST_PROJECT, + "location": TEST_LOCATION, + "gcp_conn_id": GCP_CONN_ID, + } + with pytest.raises(AirflowException): + DataflowDeletePipelineOperator(**init_kwargs).execute(mock.MagicMock()).return_value = { + "error": {"message": "example error"} + } diff --git a/tests/providers/google/cloud/operators/test_datapipeline.py b/tests/providers/google/cloud/operators/test_datapipeline.py index 2a948edf781c3..1b403d67fbe6e 100644 --- a/tests/providers/google/cloud/operators/test_datapipeline.py +++ b/tests/providers/google/cloud/operators/test_datapipeline.py @@ -21,7 +21,6 @@ import pytest -from airflow.exceptions import AirflowException from airflow.providers.google.cloud.operators.datapipeline import ( CreateDataPipelineOperator, RunDataPipelineOperator, @@ -48,7 +47,7 @@ }, } TEST_LOCATION = "test-location" -TEST_PROJECTID = "test-project-id" +TEST_PROJECT_ID = "test-project-id" TEST_GCP_CONN_ID = "test_gcp_conn_id" TEST_DATA_PIPELINE_NAME = "test_data_pipeline_name" @@ -62,12 +61,12 @@ def create_operator(self): return CreateDataPipelineOperator( task_id="test_create_datapipeline", body=TEST_BODY, - project_id=TEST_PROJECTID, + project_id=TEST_PROJECT_ID, location=TEST_LOCATION, gcp_conn_id=TEST_GCP_CONN_ID, ) - @mock.patch("airflow.providers.google.cloud.operators.datapipeline.DataPipelineHook") + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") def test_execute(self, mock_hook, create_operator): """ Test that the execute function creates and calls the DataPipeline hook with the correct parameters @@ -79,67 +78,11 @@ def test_execute(self, mock_hook, create_operator): ) mock_hook.return_value.create_data_pipeline.assert_called_once_with( - project_id=TEST_PROJECTID, body=TEST_BODY, location=TEST_LOCATION + project_id=TEST_PROJECT_ID, + body=TEST_BODY, + location=TEST_LOCATION, ) - @pytest.mark.db_test - def test_body_invalid(self): - """ - Test that if the operator is not passed a Request Body, an AirflowException is raised - """ - init_kwargs = { - "task_id": "test_create_datapipeline", - "body": {}, - "project_id": TEST_PROJECTID, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - CreateDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - def test_projectid_invalid(self): - """ - Test that if the operator is not passed a Project ID, an AirflowException is raised - """ - init_kwargs = { - "task_id": "test_create_datapipeline", - "body": TEST_BODY, - "project_id": None, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - CreateDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - def test_location_invalid(self): - """ - Test that if the operator is not passed a location, an AirflowException is raised - """ - init_kwargs = { - "task_id": "test_create_datapipeline", - "body": TEST_BODY, - "project_id": TEST_PROJECTID, - "location": None, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - CreateDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - @pytest.mark.db_test - def test_response_invalid(self): - """ - Test that if the Response Body contains an error message, an AirflowException is raised - """ - init_kwargs = { - "task_id": "test_create_datapipeline", - "body": {"error": "Testing that AirflowException is raised"}, - "project_id": TEST_PROJECTID, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - CreateDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - @pytest.mark.db_test class TestRunDataPipelineOperator: @@ -151,12 +94,12 @@ def run_operator(self): return RunDataPipelineOperator( task_id=TASK_ID, data_pipeline_name=TEST_DATA_PIPELINE_NAME, - project_id=TEST_PROJECTID, + project_id=TEST_PROJECT_ID, location=TEST_LOCATION, gcp_conn_id=TEST_GCP_CONN_ID, ) - @mock.patch("airflow.providers.google.cloud.operators.datapipeline.DataPipelineHook") + @mock.patch("airflow.providers.google.cloud.operators.dataflow.DataflowHook") def test_execute(self, data_pipeline_hook_mock, run_operator): """ Test Run Operator execute with correct parameters @@ -164,68 +107,11 @@ def test_execute(self, data_pipeline_hook_mock, run_operator): run_operator.execute(mock.MagicMock()) data_pipeline_hook_mock.assert_called_once_with( gcp_conn_id=TEST_GCP_CONN_ID, + impersonation_chain=None, ) data_pipeline_hook_mock.return_value.run_data_pipeline.assert_called_once_with( - data_pipeline_name=TEST_DATA_PIPELINE_NAME, - project_id=TEST_PROJECTID, + pipeline_name=TEST_DATA_PIPELINE_NAME, + project_id=TEST_PROJECT_ID, location=TEST_LOCATION, ) - - def test_invalid_data_pipeline_name(self): - """ - Test that AirflowException is raised if Run Operator is not given a data pipeline name. - """ - init_kwargs = { - "task_id": TASK_ID, - "data_pipeline_name": None, - "project_id": TEST_PROJECTID, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - RunDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - def test_invalid_project_id(self): - """ - Test that AirflowException is raised if Run Operator is not given a project ID. - """ - init_kwargs = { - "task_id": TASK_ID, - "data_pipeline_name": TEST_DATA_PIPELINE_NAME, - "project_id": None, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - RunDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - def test_invalid_location(self): - """ - Test that AirflowException is raised if Run Operator is not given a location. - """ - init_kwargs = { - "task_id": TASK_ID, - "data_pipeline_name": TEST_DATA_PIPELINE_NAME, - "project_id": TEST_PROJECTID, - "location": None, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - RunDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()) - - def test_invalid_response(self): - """ - Test that AirflowException is raised if Run Operator fails execution and returns error. - """ - init_kwargs = { - "task_id": TASK_ID, - "data_pipeline_name": TEST_DATA_PIPELINE_NAME, - "project_id": TEST_PROJECTID, - "location": TEST_LOCATION, - "gcp_conn_id": TEST_GCP_CONN_ID, - } - with pytest.raises(AirflowException): - RunDataPipelineOperator(**init_kwargs).execute(mock.MagicMock()).return_value = { - "error": {"message": "example error"} - } diff --git a/tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py b/tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py new file mode 100644 index 0000000000000..8f41b3ed7fb2a --- /dev/null +++ b/tests/system/providers/google/cloud/dataflow/example_dataflow_pipeline.py @@ -0,0 +1,150 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" +Example Airflow DAG for testing Google Dataflow to create pipelines. +""" + +from __future__ import annotations + +import os +from datetime import datetime + +from airflow.models.dag import DAG +from airflow.providers.google.cloud.operators.dataflow import ( + DataflowCreatePipelineOperator, + DataflowDeletePipelineOperator, + DataflowRunPipelineOperator, +) +from airflow.providers.google.cloud.operators.gcs import ( + GCSCreateBucketOperator, + GCSDeleteBucketOperator, + GCSSynchronizeBucketsOperator, +) +from airflow.utils.trigger_rule import TriggerRule + +DAG_ID = "dataflow_pipeline" +ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID", "default") +GCP_PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT", "default") +GCP_LOCATION = "us-central1" + +PIPELINE_NAME = f"{DAG_ID}-{ENV_ID}".replace("_", "-") +PIPELINE_JOB_NAME = f"{DAG_ID}-{ENV_ID}-job".replace("_", "-") +PIPELINE_TYPE = "PIPELINE_TYPE_BATCH" + +RESOURCE_DATA_BUCKET = "airflow-system-tests-resources" +BUCKET_NAME = f"bucket_{DAG_ID}_{ENV_ID}".replace("-", "_") + +FILE_NAME = "kinglear.txt" +TEMPLATE_FILE = "word-count.json" + +TEMP_LOCATION = f"gs://{BUCKET_NAME}/temp" + +GCS_PATH = f"gs://{BUCKET_NAME}/dataflow/{TEMPLATE_FILE}" +INPUT_FILE = f"gs://{BUCKET_NAME}/dataflow/{FILE_NAME}" +OUTPUT = f"gs://{BUCKET_NAME}/results/hello" + +with DAG( + DAG_ID, + schedule="@once", + start_date=datetime(2021, 1, 1), + catchup=False, + tags=["example", "dataflow", "pipelines"], +) as dag: + create_bucket = GCSCreateBucketOperator(task_id="create_bucket", bucket_name=BUCKET_NAME) + + move_files_to_bucket = GCSSynchronizeBucketsOperator( + task_id="move_files_to_bucket", + source_bucket=RESOURCE_DATA_BUCKET, + source_object="dataflow/pipelines", + destination_bucket=BUCKET_NAME, + destination_object="dataflow", + recursive=True, + ) + + # [START howto_operator_create_dataflow_pipeline] + create_pipeline = DataflowCreatePipelineOperator( + task_id="create_pipeline", + project_id=GCP_PROJECT_ID, + location=GCP_LOCATION, + body={ + "name": f"projects/{GCP_PROJECT_ID}/locations/{GCP_LOCATION}/pipelines/{PIPELINE_NAME}", + "type": PIPELINE_TYPE, + "workload": { + "dataflowFlexTemplateRequest": { + "launchParameter": { + "containerSpecGcsPath": GCS_PATH, + "jobName": PIPELINE_JOB_NAME, + "environment": {"tempLocation": TEMP_LOCATION}, + "parameters": { + "inputFile": INPUT_FILE, + "output": OUTPUT, + }, + }, + "projectId": GCP_PROJECT_ID, + "location": GCP_LOCATION, + } + }, + }, + ) + # [END howto_operator_create_dataflow_pipeline] + + # [START howto_operator_run_dataflow_pipeline] + run_pipeline = DataflowRunPipelineOperator( + task_id="run_pipeline", + pipeline_name=PIPELINE_NAME, + project_id=GCP_PROJECT_ID, + ) + # [END howto_operator_run_dataflow_pipeline] + + # [START howto_operator_delete_dataflow_pipeline] + delete_pipeline = DataflowDeletePipelineOperator( + task_id="delete_pipeline", + pipeline_name=PIPELINE_NAME, + project_id=GCP_PROJECT_ID, + trigger_rule=TriggerRule.ALL_DONE, + ) + # [END howto_operator_delete_dataflow_pipeline] + + delete_bucket = GCSDeleteBucketOperator( + task_id="delete_bucket", bucket_name=BUCKET_NAME, trigger_rule=TriggerRule.ALL_DONE + ) + + ( + # TEST SETUP + create_bucket + >> move_files_to_bucket + # TEST BODY + >> create_pipeline + >> run_pipeline + # TEST TEARDOWN + >> delete_pipeline + >> delete_bucket + ) + + from tests.system.utils.watcher import watcher + + # This test needs watcher in order to properly mark success/failure + # when "teardown" task with trigger rule is part of the DAG + list(dag.tasks) >> watcher() + + +from tests.system.utils import get_test_run # noqa: E402 + +# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest) +test_run = get_test_run(dag) diff --git a/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py b/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py index 2b84be9013359..cd3538de0e8d5 100644 --- a/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py +++ b/tests/system/providers/google/cloud/datapipelines/example_datapipeline.py @@ -24,39 +24,40 @@ import os from datetime import datetime -from pathlib import Path from airflow.models.dag import DAG +from airflow.providers.google.cloud.operators.dataflow import DataflowDeletePipelineOperator from airflow.providers.google.cloud.operators.datapipeline import ( CreateDataPipelineOperator, RunDataPipelineOperator, ) -from airflow.providers.google.cloud.operators.gcs import GCSCreateBucketOperator, GCSDeleteBucketOperator -from airflow.providers.google.cloud.transfers.local_to_gcs import LocalFilesystemToGCSOperator +from airflow.providers.google.cloud.operators.gcs import ( + GCSCreateBucketOperator, + GCSDeleteBucketOperator, + GCSSynchronizeBucketsOperator, +) from airflow.utils.trigger_rule import TriggerRule -DAG_ID = "google-datapipeline" -ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID") -GCP_PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT") -GCP_LOCATION = os.environ.get("location", "us-central1") +DAG_ID = "datapipeline" +ENV_ID = os.environ.get("SYSTEM_TESTS_ENV_ID", "default") +GCP_PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT", "default") +GCP_LOCATION = "us-central1" -PIPELINE_NAME = os.environ.get("DATA_PIPELINE_NAME", "defualt-pipeline-name") +PIPELINE_NAME = f"{DAG_ID}-{ENV_ID}".replace("_", "-") +PIPELINE_JOB_NAME = f"{DAG_ID}-{ENV_ID}-job".replace("_", "-") PIPELINE_TYPE = "PIPELINE_TYPE_BATCH" -BUCKET_NAME = f"bucket_{DAG_ID}_{ENV_ID}" +RESOURCE_DATA_BUCKET = "airflow-system-tests-resources" +BUCKET_NAME = f"bucket_{DAG_ID}_{ENV_ID}".replace("-", "_") FILE_NAME = "kinglear.txt" TEMPLATE_FILE = "word-count.json" -DATAPIPELINES_JOB_NAME = "test-job-name" TEMP_LOCATION = f"gs://{BUCKET_NAME}/temp" -GCS_PATH = f"gs://{BUCKET_NAME}/templates/{TEMPLATE_FILE}" -INPUT_FILE = f"gs://{BUCKET_NAME}/examples/{FILE_NAME}" +GCS_PATH = f"gs://{BUCKET_NAME}/dataflow/{TEMPLATE_FILE}" +INPUT_FILE = f"gs://{BUCKET_NAME}/dataflow/{FILE_NAME}" OUTPUT = f"gs://{BUCKET_NAME}/results/hello" -FILE_LOCAL_PATH = str(Path(__file__).parent / "resources" / FILE_NAME) -TEMPLATE_LOCAL_PATH = str(Path(__file__).parent / "resources" / TEMPLATE_FILE) - with DAG( DAG_ID, schedule="@once", @@ -66,18 +67,13 @@ ) as dag: create_bucket = GCSCreateBucketOperator(task_id="create_bucket", bucket_name=BUCKET_NAME) - upload_file = LocalFilesystemToGCSOperator( - task_id="upload_file_to_bucket", - src=FILE_LOCAL_PATH, - dst=FILE_NAME, - bucket=BUCKET_NAME, - ) - - upload_template = LocalFilesystemToGCSOperator( - task_id="upload_template_to_bucket", - src=TEMPLATE_LOCAL_PATH, - dst=TEMPLATE_FILE, - bucket=BUCKET_NAME, + move_files_to_bucket = GCSSynchronizeBucketsOperator( + task_id="move_files_to_bucket", + source_bucket=RESOURCE_DATA_BUCKET, + source_object="dataflow/pipelines", + destination_bucket=BUCKET_NAME, + destination_object="dataflow", + recursive=True, ) # [START howto_operator_create_data_pipeline] @@ -92,7 +88,7 @@ "dataflowFlexTemplateRequest": { "launchParameter": { "containerSpecGcsPath": GCS_PATH, - "jobName": DATAPIPELINES_JOB_NAME, + "jobName": PIPELINE_JOB_NAME, "environment": {"tempLocation": TEMP_LOCATION}, "parameters": { "inputFile": INPUT_FILE, @@ -107,11 +103,38 @@ ) # [END howto_operator_create_data_pipeline] + # [START howto_operator_run_data_pipeline] + run_data_pipeline = RunDataPipelineOperator( + task_id="run_data_pipeline", + data_pipeline_name=PIPELINE_NAME, + project_id=GCP_PROJECT_ID, + ) + # [END howto_operator_run_data_pipeline] + + # [START howto_operator_delete_dataflow_pipeline] + delete_pipeline = DataflowDeletePipelineOperator( + task_id="delete_data_pipeline", + pipeline_name=PIPELINE_NAME, + project_id=GCP_PROJECT_ID, + trigger_rule=TriggerRule.ALL_DONE, + ) + # [END howto_operator_delete_dataflow_pipeline] + delete_bucket = GCSDeleteBucketOperator( task_id="delete_bucket", bucket_name=BUCKET_NAME, trigger_rule=TriggerRule.ALL_DONE ) - (create_bucket >> upload_file >> upload_template >> create_data_pipeline >> delete_bucket) + ( + # TEST SETUP + create_bucket + >> move_files_to_bucket + # TEST BODY + >> create_data_pipeline + >> run_data_pipeline + # TEST TEARDOWN + >> delete_pipeline + >> delete_bucket + ) from tests.system.utils.watcher import watcher @@ -119,13 +142,6 @@ # when "teardown" task with trigger rule is part of the DAG list(dag.tasks) >> watcher() - # [START howto_operator_run_data_pipeline] - run_data_pipeline = RunDataPipelineOperator( - task_id="run_data_pipeline", - data_pipeline_name=PIPELINE_NAME, - project_id=GCP_PROJECT_ID, - ) - # [END howto_operator_run_data_pipeline] from tests.system.utils import get_test_run # noqa: E402 diff --git a/tests/system/providers/google/cloud/datapipelines/resources/__init__.py b/tests/system/providers/google/cloud/datapipelines/resources/__init__.py deleted file mode 100644 index 13a83393a9124..0000000000000 --- a/tests/system/providers/google/cloud/datapipelines/resources/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. diff --git a/tests/system/providers/google/cloud/datapipelines/resources/kinglear.txt b/tests/system/providers/google/cloud/datapipelines/resources/kinglear.txt deleted file mode 100644 index a863ef33d227e..0000000000000 --- a/tests/system/providers/google/cloud/datapipelines/resources/kinglear.txt +++ /dev/null @@ -1,4273 +0,0 @@ -1606 -THE TRAGEDY OF KING LEAR - -by William Shakespeare - - - - -Dramatis Personae - - Lear, King of Britain. - King of France. - Duke of Burgundy. - Duke of Cornwall. - Duke of Albany. - Earl of Kent. - Earl of Gloucester. - Edgar, son of Gloucester. - Edmund, bastard son to Gloucester. - Curan, a courtier. - Old Man, tenant to Gloucester. - Doctor. - Lear's Fool. - Oswald, steward to Goneril. - A Captain under Edmund's command. - Gentlemen. - A Herald. - Servants to Cornwall. - - Goneril, daughter to Lear. - Regan, daughter to Lear. - Cordelia, daughter to Lear. - - Knights attending on Lear, Officers, Messengers, Soldiers, - Attendants. - - - - -<> - - - -Scene: - Britain. - - -ACT I. Scene I. -[King Lear's Palace.] - -Enter Kent, Gloucester, and Edmund. [Kent and Glouceste converse. -Edmund stands back.] - - Kent. I thought the King had more affected the Duke of Albany -than - Cornwall. - Glou. It did always seem so to us; but now, in the division of -the - kingdom, it appears not which of the Dukes he values most, -for - equalities are so weigh'd that curiosity in neither can make - choice of either's moiety. - Kent. Is not this your son, my lord? - Glou. His breeding, sir, hath been at my charge. I have so -often - blush'd to acknowledge him that now I am braz'd to't. - Kent. I cannot conceive you. - Glou. Sir, this young fellow's mother could; whereupon she grew - round-womb'd, and had indeed, sir, a son for her cradle ere -she - had a husband for her bed. Do you smell a fault? - Kent. I cannot wish the fault undone, the issue of it being so - proper. - Glou. But I have, sir, a son by order of law, some year elder -than - this, who yet is no dearer in my account. Though this knave -came - something saucily into the world before he was sent for, yet -was - his mother fair, there was good sport at his making, and the - whoreson must be acknowledged.- Do you know this noble -gentleman, - Edmund? - Edm. [comes forward] No, my lord. - Glou. My Lord of Kent. Remember him hereafter as my honourable - friend. - Edm. My services to your lordship. - Kent. I must love you, and sue to know you better. - Edm. Sir, I shall study deserving. - Glou. He hath been out nine years, and away he shall again. - Sound a sennet. - The King is coming. - - Enter one bearing a coronet; then Lear; then the Dukes of - Albany and Cornwall; next, Goneril, Regan, Cordelia, with - Followers. - - Lear. Attend the lords of France and Burgundy, Gloucester. - Glou. I shall, my liege. - Exeunt [Gloucester and Edmund]. - Lear. Meantime we shall express our darker purpose. - Give me the map there. Know we have divided - In three our kingdom; and 'tis our fast intent - To shake all cares and business from our age, - Conferring them on younger strengths while we - Unburthen'd crawl toward death. Our son of Cornwall, - And you, our no less loving son of Albany, - We have this hour a constant will to publish - Our daughters' several dowers, that future strife - May be prevented now. The princes, France and Burgundy, - Great rivals in our youngest daughter's love, - Long in our court have made their amorous sojourn, - And here are to be answer'd. Tell me, my daughters - (Since now we will divest us both of rule, - Interest of territory, cares of state), - Which of you shall we say doth love us most? - That we our largest bounty may extend - Where nature doth with merit challenge. Goneril, - Our eldest-born, speak first. - Gon. Sir, I love you more than words can wield the matter; - Dearer than eyesight, space, and liberty; - Beyond what can be valued, rich or rare; - No less than life, with grace, health, beauty, honour; - As much as child e'er lov'd, or father found; - A love that makes breath poor, and speech unable. - Beyond all manner of so much I love you. - Cor. [aside] What shall Cordelia speak? Love, and be silent. - Lear. Of all these bounds, even from this line to this, - With shadowy forests and with champains rich'd, - With plenteous rivers and wide-skirted meads, - We make thee lady. To thine and Albany's issue - Be this perpetual.- What says our second daughter, - Our dearest Regan, wife to Cornwall? Speak. - Reg. Sir, I am made - Of the selfsame metal that my sister is, - And prize me at her worth. In my true heart - I find she names my very deed of love; - Only she comes too short, that I profess - Myself an enemy to all other joys - Which the most precious square of sense possesses, - And find I am alone felicitate - In your dear Highness' love. - Cor. [aside] Then poor Cordelia! - And yet not so; since I am sure my love's - More richer than my tongue. - Lear. To thee and thine hereditary ever - Remain this ample third of our fair kingdom, - No less in space, validity, and pleasure - Than that conferr'd on Goneril.- Now, our joy, - Although the last, not least; to whose young love - The vines of France and milk of Burgundy - Strive to be interest; what can you say to draw - A third more opulent than your sisters? Speak. - Cor. Nothing, my lord. - Lear. Nothing? - Cor. Nothing. - Lear. Nothing can come of nothing. Speak again. - Cor. Unhappy that I am, I cannot heave - My heart into my mouth. I love your Majesty - According to my bond; no more nor less. - Lear. How, how, Cordelia? Mend your speech a little, - Lest it may mar your fortunes. - Cor. Good my lord, - You have begot me, bred me, lov'd me; I - Return those duties back as are right fit, - Obey you, love you, and most honour you. - Why have my sisters husbands, if they say - They love you all? Haply, when I shall wed, - That lord whose hand must take my plight shall carry - Half my love with him, half my care and duty. - Sure I shall never marry like my sisters, - To love my father all. - Lear. But goes thy heart with this? - Cor. Ay, good my lord. - Lear. So young, and so untender? - Cor. So young, my lord, and true. - Lear. Let it be so! thy truth then be thy dower! - For, by the sacred radiance of the sun, - The mysteries of Hecate and the night; - By all the operation of the orbs - From whom we do exist and cease to be; - Here I disclaim all my paternal care, - Propinquity and property of blood, - And as a stranger to my heart and me - Hold thee from this for ever. The barbarous Scythian, - Or he that makes his generation messes - To gorge his appetite, shall to my bosom - Be as well neighbour'd, pitied, and reliev'd, - As thou my sometime daughter. - Kent. Good my liege- - Lear. Peace, Kent! - Come not between the dragon and his wrath. - I lov'd her most, and thought to set my rest - On her kind nursery.- Hence and avoid my sight!- - So be my grave my peace as here I give - Her father's heart from her! Call France! Who stirs? - Call Burgundy! Cornwall and Albany, - With my two daughters' dowers digest this third; - Let pride, which she calls plainness, marry her. - I do invest you jointly in my power, - Preeminence, and all the large effects - That troop with majesty. Ourself, by monthly course, - With reservation of an hundred knights, - By you to be sustain'd, shall our abode - Make with you by due turns. Only we still retain - The name, and all th' additions to a king. The sway, - Revenue, execution of the rest, - Beloved sons, be yours; which to confirm, - This coronet part betwixt you. - Kent. Royal Lear, - Whom I have ever honour'd as my king, - Lov'd as my father, as my master follow'd, - As my great patron thought on in my prayers- - Lear. The bow is bent and drawn; make from the shaft. - Kent. Let it fall rather, though the fork invade - The region of my heart! Be Kent unmannerly - When Lear is mad. What wouldst thou do, old man? - Think'st thou that duty shall have dread to speak - When power to flattery bows? To plainness honour's bound - When majesty falls to folly. Reverse thy doom; - And in thy best consideration check - This hideous rashness. Answer my life my judgment, - Thy youngest daughter does not love thee least, - Nor are those empty-hearted whose low sound - Reverbs no hollowness. - Lear. Kent, on thy life, no more! - Kent. My life I never held but as a pawn - To wage against thine enemies; nor fear to lose it, - Thy safety being the motive. - Lear. Out of my sight! - Kent. See better, Lear, and let me still remain - The true blank of thine eye. - Lear. Now by Apollo- - Kent. Now by Apollo, King, - Thou swear'st thy gods in vain. - Lear. O vassal! miscreant! - [Lays his hand on his sword.] - Alb., Corn. Dear sir, forbear! - Kent. Do! - Kill thy physician, and the fee bestow - Upon the foul disease. Revoke thy gift, - Or, whilst I can vent clamour from my throat, - I'll tell thee thou dost evil. - Lear. Hear me, recreant! - On thine allegiance, hear me! - Since thou hast sought to make us break our vow- - Which we durst never yet- and with strain'd pride - To come between our sentence and our power,- - Which nor our nature nor our place can bear,- - Our potency made good, take thy reward. - Five days we do allot thee for provision - To shield thee from diseases of the world, - And on the sixth to turn thy hated back - Upon our kingdom. If, on the tenth day following, - Thy banish'd trunk be found in our dominions, - The moment is thy death. Away! By Jupiter, - This shall not be revok'd. - Kent. Fare thee well, King. Since thus thou wilt appear, - Freedom lives hence, and banishment is here. - [To Cordelia] The gods to their dear shelter take thee, -maid, - That justly think'st and hast most rightly said! - [To Regan and Goneril] And your large speeches may your -deeds - approve, - That good effects may spring from words of love. - Thus Kent, O princes, bids you all adieu; - He'll shape his old course in a country new. -Exit. - - Flourish. Enter Gloucester, with France and Burgundy; -Attendants. - - Glou. Here's France and Burgundy, my noble lord. - Lear. My Lord of Burgundy, - We first address toward you, who with this king - Hath rivall'd for our daughter. What in the least - Will you require in present dower with her, - Or cease your quest of love? - Bur. Most royal Majesty, - I crave no more than hath your Highness offer'd, - Nor will you tender less. - Lear. Right noble Burgundy, - When she was dear to us, we did hold her so; - But now her price is fall'n. Sir, there she stands. - If aught within that little seeming substance, - Or all of it, with our displeasure piec'd, - And nothing more, may fitly like your Grace, - She's there, and she is yours. - Bur. I know no answer. - Lear. Will you, with those infirmities she owes, - Unfriended, new adopted to our hate, - Dow'r'd with our curse, and stranger'd with our oath, - Take her, or leave her? - Bur. Pardon me, royal sir. - Election makes not up on such conditions. - Lear. Then leave her, sir; for, by the pow'r that made me, - I tell you all her wealth. [To France] For you, great King, - I would not from your love make such a stray - To match you where I hate; therefore beseech you - T' avert your liking a more worthier way - Than on a wretch whom nature is asham'd - Almost t' acknowledge hers. - France. This is most strange, - That she that even but now was your best object, - The argument of your praise, balm of your age, - Most best, most dearest, should in this trice of time - Commit a thing so monstrous to dismantle - So many folds of favour. Sure her offence - Must be of such unnatural degree - That monsters it, or your fore-vouch'd affection - Fall'n into taint; which to believe of her - Must be a faith that reason without miracle - Should never plant in me. - Cor. I yet beseech your Majesty, - If for I want that glib and oily art - To speak and purpose not, since what I well intend, - I'll do't before I speak- that you make known - It is no vicious blot, murther, or foulness, - No unchaste action or dishonoured step, - That hath depriv'd me of your grace and favour; - But even for want of that for which I am richer- - A still-soliciting eye, and such a tongue - As I am glad I have not, though not to have it - Hath lost me in your liking. - Lear. Better thou - Hadst not been born than not t' have pleas'd me better. - France. Is it but this- a tardiness in nature - Which often leaves the history unspoke - That it intends to do? My Lord of Burgundy, - What say you to the lady? Love's not love - When it is mingled with regards that stands - Aloof from th' entire point. Will you have her? - She is herself a dowry. - Bur. Royal Lear, - Give but that portion which yourself propos'd, - And here I take Cordelia by the hand, - Duchess of Burgundy. - Lear. Nothing! I have sworn; I am firm. - Bur. I am sorry then you have so lost a father - That you must lose a husband. - Cor. Peace be with Burgundy! - Since that respects of fortune are his love, - I shall not be his wife. - France. Fairest Cordelia, that art most rich, being poor; - Most choice, forsaken; and most lov'd, despis'd! - Thee and thy virtues here I seize upon. - Be it lawful I take up what's cast away. - Gods, gods! 'tis strange that from their cold'st neglect - My love should kindle to inflam'd respect. - Thy dow'rless daughter, King, thrown to my chance, - Is queen of us, of ours, and our fair France. - Not all the dukes in wat'rish Burgundy - Can buy this unpriz'd precious maid of me. - Bid them farewell, Cordelia, though unkind. - Thou losest here, a better where to find. - Lear. Thou hast her, France; let her be thine; for we - Have no such daughter, nor shall ever see - That face of hers again. Therefore be gone - Without our grace, our love, our benison. - Come, noble Burgundy. - Flourish. Exeunt Lear, Burgundy, [Cornwall, Albany, - Gloucester, and Attendants]. - France. Bid farewell to your sisters. - Cor. The jewels of our father, with wash'd eyes - Cordelia leaves you. I know you what you are; - And, like a sister, am most loath to call - Your faults as they are nam'd. Use well our father. - To your professed bosoms I commit him; - But yet, alas, stood I within his grace, - I would prefer him to a better place! - So farewell to you both. - Gon. Prescribe not us our duties. - Reg. Let your study - Be to content your lord, who hath receiv'd you - At fortune's alms. You have obedience scanted, - And well are worth the want that you have wanted. - Cor. Time shall unfold what plighted cunning hides. - Who cover faults, at last shame them derides. - Well may you prosper! - France. Come, my fair Cordelia. - Exeunt France and Cordelia. - Gon. Sister, it is not little I have to say of what most nearly - appertains to us both. I think our father will hence -to-night. - Reg. That's most certain, and with you; next month with us. - Gon. You see how full of changes his age is. The observation we - have made of it hath not been little. He always lov'd our - sister most, and with what poor judgment he hath now cast -her - off appears too grossly. - Reg. 'Tis the infirmity of his age; yet he hath ever but -slenderly - known himself. - Gon. The best and soundest of his time hath been but rash; then - must we look to receive from his age, not alone the - imperfections of long-ingraffed condition, but therewithal - the unruly waywardness that infirm and choleric years bring -with - them. - Reg. Such unconstant starts are we like to have from him as -this - of Kent's banishment. - Gon. There is further compliment of leave-taking between France -and - him. Pray you let's hit together. If our father carry -authority - with such dispositions as he bears, this last surrender of -his - will but offend us. - Reg. We shall further think on't. - Gon. We must do something, and i' th' heat. - Exeunt. - - - - -Scene II. -The Earl of Gloucester's Castle. - -Enter [Edmund the] Bastard solus, [with a letter]. - - Edm. Thou, Nature, art my goddess; to thy law - My services are bound. Wherefore should I - Stand in the plague of custom, and permit - The curiosity of nations to deprive me, - For that I am some twelve or fourteen moonshines - Lag of a brother? Why bastard? wherefore base? - When my dimensions are as well compact, - My mind as generous, and my shape as true, - As honest madam's issue? Why brand they us - With base? with baseness? bastardy? base, base? - Who, in the lusty stealth of nature, take - More composition and fierce quality - Than doth, within a dull, stale, tired bed, - Go to th' creating a whole tribe of fops - Got 'tween asleep and wake? Well then, - Legitimate Edgar, I must have your land. - Our father's love is to the bastard Edmund - As to th' legitimate. Fine word- 'legitimate'! - Well, my legitimate, if this letter speed, - And my invention thrive, Edmund the base - Shall top th' legitimate. I grow; I prosper. - Now, gods, stand up for bastards! - - Enter Gloucester. - - Glou. Kent banish'd thus? and France in choler parted? - And the King gone to-night? subscrib'd his pow'r? - Confin'd to exhibition? All this done - Upon the gad? Edmund, how now? What news? - Edm. So please your lordship, none. - [Puts up the letter.] - Glou. Why so earnestly seek you to put up that letter? - Edm. I know no news, my lord. - Glou. What paper were you reading? - Edm. Nothing, my lord. - Glou. No? What needed then that terrible dispatch of it into -your - pocket? The quality of nothing hath not such need to hide - itself. Let's see. Come, if it be nothing, I shall not need - spectacles. - Edm. I beseech you, sir, pardon me. It is a letter from my -brother - that I have not all o'er-read; and for so much as I have - perus'd, I find it not fit for your o'erlooking. - Glou. Give me the letter, sir. - Edm. I shall offend, either to detain or give it. The contents, -as - in part I understand them, are to blame. - Glou. Let's see, let's see! - Edm. I hope, for my brother's justification, he wrote this but -as - an essay or taste of my virtue. - - Glou. (reads) 'This policy and reverence of age makes the world - bitter to the best of our times; keeps our fortunes from us - till our oldness cannot relish them. I begin to find an idle - and fond bondage in the oppression of aged tyranny, who -sways, - not as it hath power, but as it is suffer'd. Come to me, -that - of this I may speak more. If our father would sleep till I - wak'd him, you should enjoy half his revenue for ever, and -live - the beloved of your brother, - 'EDGAR.' - - Hum! Conspiracy? 'Sleep till I wak'd him, you should enjoy -half - his revenue.' My son Edgar! Had he a hand to write this? a -heart - and brain to breed it in? When came this to you? Who brought -it? - Edm. It was not brought me, my lord: there's the cunning of it. -I - found it thrown in at the casement of my closet. - Glou. You know the character to be your brother's? - Edm. If the matter were good, my lord, I durst swear it were -his; - but in respect of that, I would fain think it were not. - Glou. It is his. - Edm. It is his hand, my lord; but I hope his heart is not in -the - contents. - Glou. Hath he never before sounded you in this business? - Edm. Never, my lord. But I have heard him oft maintain it to be -fit - that, sons at perfect age, and fathers declining, the father - should be as ward to the son, and the son manage his -revenue. - Glou. O villain, villain! His very opinion in the letter! -Abhorred - villain! Unnatural, detested, brutish villain! worse than - brutish! Go, sirrah, seek him. I'll apprehend him. -Abominable - villain! Where is he? - Edm. I do not well know, my lord. If it shall please you to -suspend - your indignation against my brother till you can derive from -him - better testimony of his intent, you should run a certain -course; - where, if you violently proceed against him, mistaking his - purpose, it would make a great gap in your own honour and -shake - in pieces the heart of his obedience. I dare pawn down my -life - for him that he hath writ this to feel my affection to your - honour, and to no other pretence of danger. - Glou. Think you so? - Edm. If your honour judge it meet, I will place you where you -shall - hear us confer of this and by an auricular assurance have -your - satisfaction, and that without any further delay than this -very - evening. - Glou. He cannot be such a monster. - Edm. Nor is not, sure. - Glou. To his father, that so tenderly and entirely loves him. - Heaven and earth! Edmund, seek him out; wind me into him, I -pray - you; frame the business after your own wisdom. I would -unstate - myself to be in a due resolution. - Edm. I will seek him, sir, presently; convey the business as I - shall find means, and acquaint you withal. - Glou. These late eclipses in the sun and moon portend no good -to - us. Though the wisdom of nature can reason it thus and thus, -yet - nature finds itself scourg'd by the sequent effects. Love -cools, - friendship falls off, brothers divide. In cities, mutinies; -in - countries, discord; in palaces, treason; and the bond -crack'd - 'twixt son and father. This villain of mine comes under the - prediction; there's son against father: the King falls from -bias - of nature; there's father against child. We have seen the -best - of our time. Machinations, hollowness, treachery, and all - ruinous disorders follow us disquietly to our graves. Find -out - this villain, Edmund; it shall lose thee nothing; do it - carefully. And the noble and true-hearted Kent banish'd! his - offence, honesty! 'Tis strange. Exit. - Edm. This is the excellent foppery of the world, that, when we -are - sick in fortune, often the surfeit of our own behaviour, we -make - guilty of our disasters the sun, the moon, and the stars; as -if - we were villains on necessity; fools by heavenly compulsion; - knaves, thieves, and treachers by spherical pre-dominance; - drunkards, liars, and adulterers by an enforc'd obedience of - planetary influence; and all that we are evil in, by a -divine - thrusting on. An admirable evasion of whore-master man, to -lay - his goatish disposition to the charge of a star! My father - compounded with my mother under the Dragon's Tail, and my - nativity was under Ursa Major, so that it follows I am rough -and - lecherous. Fut! I should have been that I am, had the - maidenliest star in the firmament twinkled on my -bastardizing. - Edgar- - - Enter Edgar. - - and pat! he comes, like the catastrophe of the old comedy. -My - cue is villainous melancholy, with a sigh like Tom o' -Bedlam. - O, these eclipses do portend these divisions! Fa, sol, la, -mi. - Edg. How now, brother Edmund? What serious contemplation are -you - in? - Edm. I am thinking, brother, of a prediction I read this other -day, - what should follow these eclipses. - Edg. Do you busy yourself with that? - Edm. I promise you, the effects he writes of succeed unhappily: -as - of unnaturalness between the child and the parent; death, - dearth, dissolutions of ancient amities; divisions in state, - menaces and maledictions against king and nobles; needless - diffidences, banishment of friends, dissipation of cohorts, - nuptial breaches, and I know not what. - Edg. How long have you been a sectary astronomical? - Edm. Come, come! When saw you my father last? - Edg. The night gone by. - Edm. Spake you with him? - Edg. Ay, two hours together. - Edm. Parted you in good terms? Found you no displeasure in him -by - word or countenance - Edg. None at all. - Edm. Bethink yourself wherein you may have offended him; and at -my - entreaty forbear his presence until some little time hath - qualified the heat of his displeasure, which at this instant -so - rageth in him that with the mischief of your person it would - scarcely allay. - Edg. Some villain hath done me wrong. - Edm. That's my fear. I pray you have a continent forbearance -till - the speed of his rage goes slower; and, as I say, retire -with me - to my lodging, from whence I will fitly bring you to hear my - lord speak. Pray ye, go! There's my key. If you do stir -abroad, - go arm'd. - Edg. Arm'd, brother? - Edm. Brother, I advise you to the best. Go arm'd. I am no -honest man - if there be any good meaning toward you. I have told you -what I - have seen and heard; but faintly, nothing like the image and - horror of it. Pray you, away! - Edg. Shall I hear from you anon? - Edm. I do serve you in this business. - Exit Edgar. - A credulous father! and a brother noble, - Whose nature is so far from doing harms - That he suspects none; on whose foolish honesty - My practices ride easy! I see the business. - Let me, if not by birth, have lands by with; - All with me's meet that I can fashion fit. -Exit. - - - - -Scene III. -The Duke of Albany's Palace. - -Enter Goneril and [her] Steward [Oswald]. - - Gon. Did my father strike my gentleman for chiding of his fool? - Osw. Ay, madam. - Gon. By day and night, he wrongs me! Every hour - He flashes into one gross crime or other - That sets us all at odds. I'll not endure it. - His knights grow riotous, and himself upbraids us - On every trifle. When he returns from hunting, - I will not speak with him. Say I am sick. - If you come slack of former services, - You shall do well; the fault of it I'll answer. - [Horns within.] - Osw. He's coming, madam; I hear him. - Gon. Put on what weary negligence you please, - You and your fellows. I'd have it come to question. - If he distaste it, let him to our sister, - Whose mind and mine I know in that are one, - Not to be overrul'd. Idle old man, - That still would manage those authorities - That he hath given away! Now, by my life, - Old fools are babes again, and must be us'd - With checks as flatteries, when they are seen abus'd. - Remember what I have said. - Osw. Very well, madam. - Gon. And let his knights have colder looks among you. - What grows of it, no matter. Advise your fellows so. - I would breed from hence occasions, and I shall, - That I may speak. I'll write straight to my sister - To hold my very course. Prepare for dinner. - Exeunt. - - - - -Scene IV. -The Duke of Albany's Palace. - -Enter Kent, [disguised]. - - Kent. If but as well I other accents borrow, - That can my speech defuse, my good intent - May carry through itself to that full issue - For which I raz'd my likeness. Now, banish'd Kent, - If thou canst serve where thou dost stand condemn'd, - So may it come, thy master, whom thou lov'st, - Shall find thee full of labours. - - Horns within. Enter Lear, [Knights,] and Attendants. - - Lear. Let me not stay a jot for dinner; go get it ready. [Exit - an Attendant.] How now? What art thou? - Kent. A man, sir. - Lear. What dost thou profess? What wouldst thou with us? - Kent. I do profess to be no less than I seem, to serve him -truly - that will put me in trust, to love him that is honest, to - converse with him that is wise and says little, to fear - judgment, to fight when I cannot choose, and to eat no fish. - Lear. What art thou? - Kent. A very honest-hearted fellow, and as poor as the King. - Lear. If thou be'st as poor for a subject as he's for a king, -thou - art poor enough. What wouldst thou? - Kent. Service. - Lear. Who wouldst thou serve? - Kent. You. - Lear. Dost thou know me, fellow? - Kent. No, sir; but you have that in your countenance which I -would - fain call master. - Lear. What's that? - Kent. Authority. - Lear. What services canst thou do? - Kent. I can keep honest counsel, ride, run, mar a curious tale -in - telling it and deliver a plain message bluntly. That which - ordinary men are fit for, I am qualified in, and the best of -me - is diligence. - Lear. How old art thou? - Kent. Not so young, sir, to love a woman for singing, nor so -old to - dote on her for anything. I have years on my back -forty-eight. - Lear. Follow me; thou shalt serve me. If I like thee no worse -after - dinner, I will not part from thee yet. Dinner, ho, dinner! - Where's my knave? my fool? Go you and call my fool hither. - - [Exit an attendant.] - - Enter [Oswald the] Steward. - - You, you, sirrah, where's my daughter? - Osw. So please you- Exit. - Lear. What says the fellow there? Call the clotpoll back. - [Exit a Knight.] Where's my fool, ho? I think the world's - asleep. - - [Enter Knight] - - How now? Where's that mongrel? - Knight. He says, my lord, your daughter is not well. - Lear. Why came not the slave back to me when I call'd him? - Knight. Sir, he answered me in the roundest manner, he would -not. - Lear. He would not? - Knight. My lord, I know not what the matter is; but to my -judgment - your Highness is not entertain'd with that ceremonious -affection - as you were won't. There's a great abatement of kindness -appears - as well in the general dependants as in the Duke himself -also - and your daughter. - Lear. Ha! say'st thou so? - Knight. I beseech you pardon me, my lord, if I be mistaken; for - my duty cannot be silent when I think your Highness wrong'd. - Lear. Thou but rememb'rest me of mine own conception. I have - perceived a most faint neglect of late, which I have rather - blamed as mine own jealous curiosity than as a very pretence - and purpose of unkindness. I will look further into't. But - where's my fool? I have not seen him this two days. - Knight. Since my young lady's going into France, sir, the fool - hath much pined away. - Lear. No more of that; I have noted it well. Go you and tell my - daughter I would speak with her. [Exit Knight.] Go you, call - hither my fool. - [Exit an Attendant.] - - Enter [Oswald the] Steward. - - O, you, sir, you! Come you hither, sir. Who am I, sir? - Osw. My lady's father. - Lear. 'My lady's father'? My lord's knave! You whoreson dog! -you - slave! you cur! - Osw. I am none of these, my lord; I beseech your pardon. - Lear. Do you bandy looks with me, you rascal? - [Strikes him.] - Osw. I'll not be strucken, my lord. - Kent. Nor tripp'd neither, you base football player? - [Trips up his heels. - Lear. I thank thee, fellow. Thou serv'st me, and I'll love -thee. - Kent. Come, sir, arise, away! I'll teach you differences. Away, - away! If you will measure your lubber's length again, tarry; -but - away! Go to! Have you wisdom? So. - [Pushes him out.] - Lear. Now, my friendly knave, I thank thee. There's earnest of -thy - service. [Gives money.] - - Enter Fool. - - Fool. Let me hire him too. Here's my coxcomb. - [Offers Kent his cap.] - Lear. How now, my pretty knave? How dost thou? - Fool. Sirrah, you were best take my coxcomb. - Kent. Why, fool? - Fool. Why? For taking one's part that's out of favour. Nay, an -thou - canst not smile as the wind sits, thou'lt catch cold -shortly. - There, take my coxcomb! Why, this fellow hath banish'd two -on's - daughters, and did the third a blessing against his will. If - thou follow him, thou must needs wear my coxcomb.- How now, - nuncle? Would I had two coxcombs and two daughters! - Lear. Why, my boy? - Fool. If I gave them all my living, I'ld keep my coxcombs -myself. - There's mine! beg another of thy daughters. - Lear. Take heed, sirrah- the whip. - Fool. Truth's a dog must to kennel; he must be whipp'd out, -when - Lady the branch may stand by th' fire and stink. - Lear. A pestilent gall to me! - Fool. Sirrah, I'll teach thee a speech. - Lear. Do. - Fool. Mark it, nuncle. - Have more than thou showest, - Speak less than thou knowest, - Lend less than thou owest, - Ride more than thou goest, - Learn more than thou trowest, - Set less than thou throwest; - Leave thy drink and thy whore, - And keep in-a-door, - And thou shalt have more - Than two tens to a score. - Kent. This is nothing, fool. - Fool. Then 'tis like the breath of an unfeed lawyer- you gave -me - nothing for't. Can you make no use of nothing, nuncle? - Lear. Why, no, boy. Nothing can be made out of nothing. - Fool. [to Kent] Prithee tell him, so much the rent of his land - comes to. He will not believe a fool. - Lear. A bitter fool! - Fool. Dost thou know the difference, my boy, between a bitter - fool and a sweet fool? - Lear. No, lad; teach me. - Fool. That lord that counsell'd thee - To give away thy land, - Come place him here by me- - Do thou for him stand. - The sweet and bitter fool - Will presently appear; - The one in motley here, - The other found out there. - Lear. Dost thou call me fool, boy? - Fool. All thy other titles thou hast given away; that thou wast - born with. - Kent. This is not altogether fool, my lord. - Fool. No, faith; lords and great men will not let me. If I had -a - monopoly out, they would have part on't. And ladies too, -they - will not let me have all the fool to myself; they'll be - snatching. Give me an egg, nuncle, and I'll give thee two - crowns. - Lear. What two crowns shall they be? - Fool. Why, after I have cut the egg i' th' middle and eat up -the - meat, the two crowns of the egg. When thou clovest thy crown -i' - th' middle and gav'st away both parts, thou bor'st thine ass -on - thy back o'er the dirt. Thou hadst little with in thy bald -crown - when thou gav'st thy golden one away. If I speak like myself -in - this, let him be whipp'd that first finds it so. - - [Sings] Fools had ne'er less grace in a year, - For wise men are grown foppish; - They know not how their wits to wear, - Their manners are so apish. - - Lear. When were you won't to be so full of songs, sirrah? - Fool. I have us'd it, nuncle, ever since thou mad'st thy -daughters - thy mother; for when thou gav'st them the rod, and put'st -down - thine own breeches, - - [Sings] Then they for sudden joy did weep, - And I for sorrow sung, - That such a king should play bo-peep - And go the fools among. - - Prithee, nuncle, keep a schoolmaster that can teach thy fool -to - lie. I would fain learn to lie. - Lear. An you lie, sirrah, we'll have you whipp'd. - Fool. I marvel what kin thou and thy daughters are. They'll -have me - whipp'd for speaking true; thou'lt have me whipp'd for -lying; - and sometimes I am whipp'd for holding my peace. I had -rather be - any kind o' thing than a fool! And yet I would not be thee, - nuncle. Thou hast pared thy with o' both sides and left -nothing - i' th' middle. Here comes one o' the parings. - - Enter Goneril. - - Lear. How now, daughter? What makes that frontlet on? Methinks -you - are too much o' late i' th' frown. - Fool. Thou wast a pretty fellow when thou hadst no need to care -for - her frowning. Now thou art an O without a figure. I am -better - than thou art now: I am a fool, thou art nothing. - [To Goneril] Yes, forsooth, I will hold my tongue. So your -face - bids me, though you say nothing. Mum, mum! - - He that keeps nor crust nor crum, - Weary of all, shall want some.- - - [Points at Lear] That's a sheal'd peascod. - Gon. Not only, sir, this your all-licens'd fool, - But other of your insolent retinue - Do hourly carp and quarrel, breaking forth - In rank and not-to-be-endured riots. Sir, - I had thought, by making this well known unto you, - To have found a safe redress, but now grow fearful, - By what yourself, too, late have spoke and done, - That you protect this course, and put it on - By your allowance; which if you should, the fault - Would not scape censure, nor the redresses sleep, - Which, in the tender of a wholesome weal, - Might in their working do you that offence - Which else were shame, that then necessity - Must call discrete proceeding. - Fool. For you know, nuncle, - - The hedge-sparrow fed the cuckoo so long - That it had it head bit off by it young. - - So out went the candle, and we were left darkling. - Lear. Are you our daughter? - Gon. Come, sir, - I would you would make use of that good wisdom - Whereof I know you are fraught, and put away - These dispositions that of late transform you - From what you rightly are. - Fool. May not an ass know when the cart draws the horse? - Whoop, Jug, I love thee! - Lear. Doth any here know me? This is not Lear. - Doth Lear walk thus? speak thus? Where are his eyes? - Either his notion weakens, his discernings - Are lethargied- Ha! waking? 'Tis not so! - Who is it that can tell me who I am? - Fool. Lear's shadow. - Lear. I would learn that; for, by the marks of sovereignty, - Knowledge, and reason, I should be false persuaded - I had daughters. - Fool. Which they will make an obedient father. - Lear. Your name, fair gentlewoman? - Gon. This admiration, sir, is much o' th' savour - Of other your new pranks. I do beseech you - To understand my purposes aright. - As you are old and reverend, you should be wise. - Here do you keep a hundred knights and squires; - Men so disorder'd, so debosh'd, and bold - That this our court, infected with their manners, - Shows like a riotous inn. Epicurism and lust - Make it more like a tavern or a brothel - Than a grac'd palace. The shame itself doth speak - For instant remedy. Be then desir'd - By her that else will take the thing she begs - A little to disquantity your train, - And the remainder that shall still depend - To be such men as may besort your age, - Which know themselves, and you. - Lear. Darkness and devils! - Saddle my horses! Call my train together! - Degenerate bastard, I'll not trouble thee; - Yet have I left a daughter. - Gon. You strike my people, and your disorder'd rabble - Make servants of their betters. - - Enter Albany. - - Lear. Woe that too late repents!- O, sir, are you come? - Is it your will? Speak, sir!- Prepare my horses. - Ingratitude, thou marble-hearted fiend, - More hideous when thou show'st thee in a child - Than the sea-monster! - Alb. Pray, sir, be patient. - Lear. [to Goneril] Detested kite, thou liest! - My train are men of choice and rarest parts, - That all particulars of duty know - And in the most exact regard support - The worships of their name.- O most small fault, - How ugly didst thou in Cordelia show! - Which, like an engine, wrench'd my frame of nature - From the fix'd place; drew from my heart all love - And added to the gall. O Lear, Lear, Lear! - Beat at this gate that let thy folly in [Strikes his head.] - And thy dear judgment out! Go, go, my people. - Alb. My lord, I am guiltless, as I am ignorant - Of what hath mov'd you. - Lear. It may be so, my lord. - Hear, Nature, hear! dear goddess, hear! - Suspend thy purpose, if thou didst intend - To make this creature fruitful. - Into her womb convey sterility; - Dry up in her the organs of increase; - And from her derogate body never spring - A babe to honour her! If she must teem, - Create her child of spleen, that it may live - And be a thwart disnatur'd torment to her. - Let it stamp wrinkles in her brow of youth, - With cadent tears fret channels in her cheeks, - Turn all her mother's pains and benefits - To laughter and contempt, that she may feel - How sharper than a serpent's tooth it is - To have a thankless child! Away, away! Exit. - Alb. Now, gods that we adore, whereof comes this? - Gon. Never afflict yourself to know the cause; - But let his disposition have that scope - That dotage gives it. - - Enter Lear. - - Lear. What, fifty of my followers at a clap? - Within a fortnight? - Alb. What's the matter, sir? - Lear. I'll tell thee. [To Goneril] Life and death! I am asham'd - That thou hast power to shake my manhood thus; - That these hot tears, which break from me perforce, - Should make thee worth them. Blasts and fogs upon thee! - Th' untented woundings of a father's curse - Pierce every sense about thee!- Old fond eyes, - Beweep this cause again, I'll pluck ye out, - And cast you, with the waters that you lose, - To temper clay. Yea, is it come to this? - Let it be so. Yet have I left a daughter, - Who I am sure is kind and comfortable. - When she shall hear this of thee, with her nails - She'll flay thy wolvish visage. Thou shalt find - That I'll resume the shape which thou dost think - I have cast off for ever; thou shalt, I warrant thee. - Exeunt [Lear, Kent, and Attendants]. - Gon. Do you mark that, my lord? - Alb. I cannot be so partial, Goneril, - To the great love I bear you - - Gon. Pray you, content.- What, Oswald, ho! - [To the Fool] You, sir, more knave than fool, after your -master! - Fool. Nuncle Lear, nuncle Lear, tarry! Take the fool with thee. - - - A fox when one has caught her, - And such a daughter, - Should sure to the slaughter, - If my cap would buy a halter. - So the fool follows after. Exit. - Gon. This man hath had good counsel! A hundred knights? - 'Tis politic and safe to let him keep - At point a hundred knights; yes, that on every dream, - Each buzz, each fancy, each complaint, dislike, - He may enguard his dotage with their pow'rs - And hold our lives in mercy.- Oswald, I say! - Alb. Well, you may fear too far. - Gon. Safer than trust too far. - Let me still take away the harms I fear, - Not fear still to be taken. I know his heart. - What he hath utter'd I have writ my sister. - If she sustain him and his hundred knights, - When I have show'd th' unfitness- - - Enter [Oswald the] Steward. - - How now, Oswald? - What, have you writ that letter to my sister? - Osw. Yes, madam. - Gon. Take you some company, and away to horse! - Inform her full of my particular fear, - And thereto add such reasons of your own - As may compact it more. Get you gone, - And hasten your return. [Exit Oswald.] No, no, my lord! - This milky gentleness and course of yours, - Though I condemn it not, yet, under pardon, - You are much more at task for want of wisdom - Than prais'd for harmful mildness. - Alb. How far your eyes may pierce I cannot tell. - Striving to better, oft we mar what's well. - Gon. Nay then- - Alb. Well, well; th' event. Exeunt. - - - - -Scene V. -Court before the Duke of Albany's Palace. - -Enter Lear, Kent, and Fool. - - Lear. Go you before to Gloucester with these letters. Acquaint -my - daughter no further with anything you know than comes from -her - demand out of the letter. If your diligence be not speedy, I - shall be there afore you. - Kent. I will not sleep, my lord, till I have delivered your -letter. -Exit. - Fool. If a man's brains were in's heels, were't not in danger -of - kibes? - Lear. Ay, boy. - Fool. Then I prithee be merry. Thy with shall ne'er go -slip-shod. - Lear. Ha, ha, ha! - Fool. Shalt see thy other daughter will use thee kindly; for -though - she's as like this as a crab's like an apple, yet I can tell - what I can tell. - Lear. What canst tell, boy? - Fool. She'll taste as like this as a crab does to a crab. Thou - canst tell why one's nose stands i' th' middle on's face? - Lear. No. - Fool. Why, to keep one's eyes of either side's nose, that what -a - man cannot smell out, 'a may spy into. - Lear. I did her wrong. - Fool. Canst tell how an oyster makes his shell? - Lear. No. - Fool. Nor I neither; but I can tell why a snail has a house. - Lear. Why? - Fool. Why, to put's head in; not to give it away to his -daughters, - and leave his horns without a case. - Lear. I will forget my nature. So kind a father!- Be my horses - ready? - Fool. Thy asses are gone about 'em. The reason why the seven -stars - are no moe than seven is a pretty reason. - Lear. Because they are not eight? - Fool. Yes indeed. Thou wouldst make a good fool. - Lear. To tak't again perforce! Monster ingratitude! - Fool. If thou wert my fool, nuncle, I'ld have thee beaten for -being - old before thy time. - Lear. How's that? - Fool. Thou shouldst not have been old till thou hadst been -wise. - Lear. O, let me not be mad, not mad, sweet heaven! - Keep me in temper; I would not be mad! - - [Enter a Gentleman.] - - How now? Are the horses ready? - Gent. Ready, my lord. - Lear. Come, boy. - Fool. She that's a maid now, and laughs at my departure, - Shall not be a maid long, unless things be cut shorter - Exeunt. - - - - -<> - - - -ACT II. Scene I. -A court within the Castle of the Earl of Gloucester. - -Enter [Edmund the] Bastard and Curan, meeting. - - Edm. Save thee, Curan. - Cur. And you, sir. I have been with your father, and given him - notice that the Duke of Cornwall and Regan his Duchess will -be - here with him this night. - Edm. How comes that? - Cur. Nay, I know not. You have heard of the news abroad- I mean -the - whisper'd ones, for they are yet but ear-kissing arguments? - Edm. Not I. Pray you, what are they? - Cur. Have you heard of no likely wars toward 'twixt the two -Dukes - of Cornwall and Albany? - Edm. Not a word. - Cur. You may do, then, in time. Fare you well, sir. Exit. - Edm. The Duke be here to-night? The better! best! - This weaves itself perforce into my business. - My father hath set guard to take my brother; - And I have one thing, of a queasy question, - Which I must act. Briefness and fortune, work! - Brother, a word! Descend! Brother, I say! - - Enter Edgar. - - My father watches. O sir, fly this place! - Intelligence is given where you are hid. - You have now the good advantage of the night. - Have you not spoken 'gainst the Duke of Cornwall? - He's coming hither; now, i' th' night, i' th' haste, - And Regan with him. Have you nothing said - Upon his party 'gainst the Duke of Albany? - Advise yourself. - Edg. I am sure on't, not a word. - Edm. I hear my father coming. Pardon me! - In cunning I must draw my sword upon you. - Draw, seem to defend yourself; now quit you well.- - Yield! Come before my father. Light, ho, here! - Fly, brother.- Torches, torches!- So farewell. - Exit Edgar. - Some blood drawn on me would beget opinion - Of my more fierce endeavour. [Stabs his arm.] I have seen - drunkards - Do more than this in sport.- Father, father!- - Stop, stop! No help? - - Enter Gloucester, and Servants with torches. - - Glou. Now, Edmund, where's the villain? - Edm. Here stood he in the dark, his sharp sword out, - Mumbling of wicked charms, conjuring the moon - To stand 's auspicious mistress. - Glou. But where is he? - Edm. Look, sir, I bleed. - Glou. Where is the villain, Edmund? - Edm. Fled this way, sir. When by no means he could- - Glou. Pursue him, ho! Go after. [Exeunt some Servants]. - By no means what? - Edm. Persuade me to the murther of your lordship; - But that I told him the revenging gods - 'Gainst parricides did all their thunders bend; - Spoke with how manifold and strong a bond - The child was bound to th' father- sir, in fine, - Seeing how loathly opposite I stood - To his unnatural purpose, in fell motion - With his prepared sword he charges home - My unprovided body, lanch'd mine arm; - But when he saw my best alarum'd spirits, - Bold in the quarrel's right, rous'd to th' encounter, - Or whether gasted by the noise I made, - Full suddenly he fled. - Glou. Let him fly far. - Not in this land shall he remain uncaught; - And found- dispatch. The noble Duke my master, - My worthy arch and patron, comes to-night. - By his authority I will proclaim it - That he which find, him shall deserve our thanks, - Bringing the murderous caitiff to the stake; - He that conceals him, death. - Edm. When I dissuaded him from his intent - And found him pight to do it, with curst speech - I threaten'd to discover him. He replied, - 'Thou unpossessing bastard, dost thou think, - If I would stand against thee, would the reposal - Of any trust, virtue, or worth in thee - Make thy words faith'd? No. What I should deny - (As this I would; ay, though thou didst produce - My very character), I'ld turn it all - To thy suggestion, plot, and damned practice; - And thou must make a dullard of the world, - If they not thought the profits of my death - Were very pregnant and potential spurs - To make thee seek it.' - Glou. Strong and fast'ned villain! - Would he deny his letter? I never got him. - Tucket within. - Hark, the Duke's trumpets! I know not why he comes. - All ports I'll bar; the villain shall not scape; - The Duke must grant me that. Besides, his picture - I will send far and near, that all the kingdom - May have due note of him, and of my land, - Loyal and natural boy, I'll work the means - To make thee capable. - - Enter Cornwall, Regan, and Attendants. - - Corn. How now, my noble friend? Since I came hither - (Which I can call but now) I have heard strange news. - Reg. If it be true, all vengeance comes too short - Which can pursue th' offender. How dost, my lord? - Glou. O madam, my old heart is crack'd, it's crack'd! - Reg. What, did my father's godson seek your life? - He whom my father nam'd? Your Edgar? - Glou. O lady, lady, shame would have it hid! - Reg. Was he not companion with the riotous knights - That tend upon my father? - Glou. I know not, madam. 'Tis too bad, too bad! - Edm. Yes, madam, he was of that consort. - Reg. No marvel then though he were ill affected. - 'Tis they have put him on the old man's death, - To have th' expense and waste of his revenues. - I have this present evening from my sister - Been well inform'd of them, and with such cautions - That, if they come to sojourn at my house, - I'll not be there. - Corn. Nor I, assure thee, Regan. - Edmund, I hear that you have shown your father - A childlike office. - Edm. 'Twas my duty, sir. - Glou. He did bewray his practice, and receiv'd - This hurt you see, striving to apprehend him. - Corn. Is he pursued? - Glou. Ay, my good lord. - Corn. If he be taken, he shall never more - Be fear'd of doing harm. Make your own purpose, - How in my strength you please. For you, Edmund, - Whose virtue and obedience doth this instant - So much command itself, you shall be ours. - Natures of such deep trust we shall much need; - You we first seize on. - Edm. I shall serve you, sir, - Truly, however else. - Glou. For him I thank your Grace. - Corn. You know not why we came to visit you- - Reg. Thus out of season, threading dark-ey'd night. - Occasions, noble Gloucester, of some poise, - Wherein we must have use of your advice. - Our father he hath writ, so hath our sister, - Of differences, which I best thought it fit - To answer from our home. The several messengers - From hence attend dispatch. Our good old friend, - Lay comforts to your bosom, and bestow - Your needful counsel to our business, - Which craves the instant use. - Glou. I serve you, madam. - Your Graces are right welcome. - Exeunt. Flourish. - - - - -Scene II. -Before Gloucester's Castle. - -Enter Kent and [Oswald the] Steward, severally. - - Osw. Good dawning to thee, friend. Art of this house? - Kent. Ay. - Osw. Where may we set our horses? - Kent. I' th' mire. - Osw. Prithee, if thou lov'st me, tell me. - Kent. I love thee not. - Osw. Why then, I care not for thee. - Kent. If I had thee in Lipsbury Pinfold, I would make thee care -for - me. - Osw. Why dost thou use me thus? I know thee not. - Kent. Fellow, I know thee. - Osw. What dost thou know me for? - Kent. A knave; a rascal; an eater of broken meats; a base, -proud, - shallow, beggarly, three-suited, hundred-pound, filthy, - worsted-stocking knave; a lily-liver'd, action-taking, -whoreson, - glass-gazing, superserviceable, finical rogue; - one-trunk-inheriting slave; one that wouldst be a bawd in -way of - good service, and art nothing but the composition of a -knave, - beggar, coward, pander, and the son and heir of a mongrel -bitch; - one whom I will beat into clamorous whining, if thou deny -the - least syllable of thy addition. - Osw. Why, what a monstrous fellow art thou, thus to rail on one - that's neither known of thee nor knows thee! - Kent. What a brazen-fac'd varlet art thou, to deny thou knowest -me! - Is it two days ago since I beat thee and tripp'd up thy -heels - before the King? [Draws his sword.] Draw, you rogue! for, -though - it be night, yet the moon shines. I'll make a sop o' th' - moonshine o' you. Draw, you whoreson cullionly barbermonger! - draw! - Osw. Away! I have nothing to do with thee. - Kent. Draw, you rascal! You come with letters against the King, -and - take Vanity the puppet's part against the royalty of her -father. - Draw, you rogue, or I'll so carbonado your shanks! Draw, you - rascal! Come your ways! - Osw. Help, ho! murther! help! - Kent. Strike, you slave! Stand, rogue! Stand, you neat slave! - Strike! [Beats him.] - Osw. Help, ho! murther! murther! - - Enter Edmund, with his rapier drawn, Gloucester, Cornwall, - Regan, Servants. - - Edm. How now? What's the matter? Parts [them]. - Kent. With you, goodman boy, an you please! Come, I'll flesh -ye! - Come on, young master! - Glou. Weapons? arms? What's the matter here? - Corn. Keep peace, upon your lives! - He dies that strikes again. What is the matter? - Reg. The messengers from our sister and the King - Corn. What is your difference? Speak. - Osw. I am scarce in breath, my lord. - Kent. No marvel, you have so bestirr'd your valour. You -cowardly - rascal, nature disclaims in thee; a tailor made thee. - Corn. Thou art a strange fellow. A tailor make a man? - Kent. Ay, a tailor, sir. A stonecutter or a painter could not -have - made him so ill, though he had been but two hours at the -trade. - Corn. Speak yet, how grew your quarrel? - Osw. This ancient ruffian, sir, whose life I have spar'd - At suit of his grey beard- - Kent. Thou whoreson zed! thou unnecessary letter! My lord, if - you'll give me leave, I will thread this unbolted villain -into - mortar and daub the walls of a jakes with him. 'Spare my -grey - beard,' you wagtail? - Corn. Peace, sirrah! - You beastly knave, know you no reverence? - Kent. Yes, sir, but anger hath a privilege. - Corn. Why art thou angry? - Kent. That such a slave as this should wear a sword, - Who wears no honesty. Such smiling rogues as these, - Like rats, oft bite the holy cords atwain - Which are too intrinse t' unloose; smooth every passion - That in the natures of their lords rebel, - Bring oil to fire, snow to their colder moods; - Renege, affirm, and turn their halcyon beaks - With every gale and vary of their masters, - Knowing naught (like dogs) but following. - A plague upon your epileptic visage! - Smile you my speeches, as I were a fool? - Goose, an I had you upon Sarum Plain, - I'ld drive ye cackling home to Camelot. - Corn. What, art thou mad, old fellow? - Glou. How fell you out? Say that. - Kent. No contraries hold more antipathy - Than I and such a knave. - Corn. Why dost thou call him knave? What is his fault? - Kent. His countenance likes me not. - Corn. No more perchance does mine, or his, or hers. - Kent. Sir, 'tis my occupation to be plain. - I have seen better faces in my time - Than stands on any shoulder that I see - Before me at this instant. - Corn. This is some fellow - Who, having been prais'd for bluntness, doth affect - A saucy roughness, and constrains the garb - Quite from his nature. He cannot flatter, he! - An honest mind and plain- he must speak truth! - An they will take it, so; if not, he's plain. - These kind of knaves I know which in this plainness - Harbour more craft and more corrupter ends - Than twenty silly-ducking observants - That stretch their duties nicely. - Kent. Sir, in good faith, in sincere verity, - Under th' allowance of your great aspect, - Whose influence, like the wreath of radiant fire - On flickering Phoebus' front- - Corn. What mean'st by this? - Kent. To go out of my dialect, which you discommend so much. I - know, sir, I am no flatterer. He that beguil'd you in a -plain - accent was a plain knave, which, for my part, I will not be, - though I should win your displeasure to entreat me to't. - Corn. What was th' offence you gave him? - Osw. I never gave him any. - It pleas'd the King his master very late - To strike at me, upon his misconstruction; - When he, conjunct, and flattering his displeasure, - Tripp'd me behind; being down, insulted, rail'd - And put upon him such a deal of man - That worthied him, got praises of the King - For him attempting who was self-subdu'd; - And, in the fleshment of this dread exploit, - Drew on me here again. - Kent. None of these rogues and cowards - But Ajax is their fool. - Corn. Fetch forth the stocks! - You stubborn ancient knave, you reverent braggart, - We'll teach you- - Kent. Sir, I am too old to learn. - Call not your stocks for me. I serve the King; - On whose employment I was sent to you. - You shall do small respect, show too bold malice - Against the grace and person of my master, - Stocking his messenger. - Corn. Fetch forth the stocks! As I have life and honour, - There shall he sit till noon. - Reg. Till noon? Till night, my lord, and all night too! - Kent. Why, madam, if I were your father's dog, - You should not use me so. - Reg. Sir, being his knave, I will. - Corn. This is a fellow of the selfsame colour - Our sister speaks of. Come, bring away the stocks! - Stocks brought out. - Glou. Let me beseech your Grace not to do so. - His fault is much, and the good King his master - Will check him for't. Your purpos'd low correction - Is such as basest and contemn'dest wretches - For pilf'rings and most common trespasses - Are punish'd with. The King must take it ill - That he, so slightly valued in his messenger, - Should have him thus restrain'd. - Corn. I'll answer that. - Reg. My sister may receive it much more worse, - To have her gentleman abus'd, assaulted, - For following her affairs. Put in his legs.- - [Kent is put in the stocks.] - Come, my good lord, away. - Exeunt [all but Gloucester and Kent]. - Glou. I am sorry for thee, friend. 'Tis the Duke's pleasure, - Whose disposition, all the world well knows, - Will not be rubb'd nor stopp'd. I'll entreat for thee. - Kent. Pray do not, sir. I have watch'd and travell'd hard. - Some time I shall sleep out, the rest I'll whistle. - A good man's fortune may grow out at heels. - Give you good morrow! - Glou. The Duke 's to blame in this; 'twill be ill taken. -Exit. - Kent. Good King, that must approve the common saw, - Thou out of heaven's benediction com'st - To the warm sun! - Approach, thou beacon to this under globe, - That by thy comfortable beams I may - Peruse this letter. Nothing almost sees miracles - But misery. I know 'tis from Cordelia, - Who hath most fortunately been inform'd - Of my obscured course- and [reads] 'shall find time - From this enormous state, seeking to give - Losses their remedies'- All weary and o'erwatch'd, - Take vantage, heavy eyes, not to behold - This shameful lodging. - Fortune, good night; smile once more, turn thy wheel. - Sleeps. - - - - -Scene III. -The open country. - -Enter Edgar. - - Edg. I heard myself proclaim'd, - And by the happy hollow of a tree - Escap'd the hunt. No port is free, no place - That guard and most unusual vigilance - Does not attend my taking. Whiles I may scape, - I will preserve myself; and am bethought - To take the basest and most poorest shape - That ever penury, in contempt of man, - Brought near to beast. My face I'll grime with filth, - Blanket my loins, elf all my hair in knots, - And with presented nakedness outface - The winds and persecutions of the sky. - The country gives me proof and precedent - Of Bedlam beggars, who, with roaring voices, - Strike in their numb'd and mortified bare arms - Pins, wooden pricks, nails, sprigs of rosemary; - And with this horrible object, from low farms, - Poor pelting villages, sheepcotes, and mills, - Sometime with lunatic bans, sometime with prayers, - Enforce their charity. 'Poor Turlygod! poor Tom!' - That's something yet! Edgar I nothing am. Exit. - - - - -Scene IV. -Before Gloucester's Castle; Kent in the stocks. - -Enter Lear, Fool, and Gentleman. - - Lear. 'Tis strange that they should so depart from home, - And not send back my messenger. - Gent. As I learn'd, - The night before there was no purpose in them - Of this remove. - Kent. Hail to thee, noble master! - Lear. Ha! - Mak'st thou this shame thy pastime? - Kent. No, my lord. - Fool. Ha, ha! look! he wears cruel garters. Horses are tied by -the - head, dogs and bears by th' neck, monkeys by th' loins, and -men - by th' legs. When a man's over-lusty at legs, then he wears - wooden nether-stocks. - Lear. What's he that hath so much thy place mistook - To set thee here? - Kent. It is both he and she- - Your son and daughter. - Lear. No. - Kent. Yes. - Lear. No, I say. - Kent. I say yea. - Lear. No, no, they would not! - Kent. Yes, they have. - Lear. By Jupiter, I swear no! - Kent. By Juno, I swear ay! - Lear. They durst not do't; - They would not, could not do't. 'Tis worse than murther - To do upon respect such violent outrage. - Resolve me with all modest haste which way - Thou mightst deserve or they impose this usage, - Coming from us. - Kent. My lord, when at their home - I did command your Highness' letters to them, - Ere I was risen from the place that show'd - My duty kneeling, came there a reeking post, - Stew'd in his haste, half breathless, painting forth - From Goneril his mistress salutations; - Deliver'd letters, spite of intermission, - Which presently they read; on whose contents, - They summon'd up their meiny, straight took horse, - Commanded me to follow and attend - The leisure of their answer, gave me cold looks, - And meeting here the other messenger, - Whose welcome I perceiv'd had poison'd mine- - Being the very fellow which of late - Display'd so saucily against your Highness- - Having more man than with about me, drew. - He rais'd the house with loud and coward cries. - Your son and daughter found this trespass worth - The shame which here it suffers. - Fool. Winter's not gone yet, if the wild geese fly that way. - - Fathers that wear rags - Do make their children blind; - But fathers that bear bags - Shall see their children kind. - Fortune, that arrant whore, - Ne'er turns the key to th' poor. - - But for all this, thou shalt have as many dolours for thy - daughters as thou canst tell in a year. - Lear. O, how this mother swells up toward my heart! - Hysterica passio! Down, thou climbing sorrow! - Thy element's below! Where is this daughter? - Kent. With the Earl, sir, here within. - Lear. Follow me not; - Stay here. Exit. - Gent. Made you no more offence but what you speak of? - Kent. None. - How chance the King comes with so small a number? - Fool. An thou hadst been set i' th' stocks for that question, - thou'dst well deserv'd it. - Kent. Why, fool? - Fool. We'll set thee to school to an ant, to teach thee there's -no - labouring i' th' winter. All that follow their noses are led -by - their eyes but blind men, and there's not a nose among -twenty - but can smell him that's stinking. Let go thy hold when a -great - wheel runs down a hill, lest it break thy neck with -following - it; but the great one that goes upward, let him draw thee -after. - When a wise man gives thee better counsel, give me mine -again. I - would have none but knaves follow it, since a fool gives it. - That sir which serves and seeks for gain, - And follows but for form, - Will pack when it begins to rain - And leave thee in the storm. - But I will tarry; the fool will stay, - And let the wise man fly. - The knave turns fool that runs away; - The fool no knave, perdy. - Kent. Where learn'd you this, fool? - Fool. Not i' th' stocks, fool. - - Enter Lear and Gloucester - - Lear. Deny to speak with me? They are sick? they are weary? - They have travell'd all the night? Mere fetches- - The images of revolt and flying off! - Fetch me a better answer. - Glou. My dear lord, - You know the fiery quality of the Duke, - How unremovable and fix'd he is - In his own course. - Lear. Vengeance! plague! death! confusion! - Fiery? What quality? Why, Gloucester, Gloucester, - I'ld speak with the Duke of Cornwall and his wife. - Glou. Well, my good lord, I have inform'd them so. - Lear. Inform'd them? Dost thou understand me, man? - Glou. Ay, my good lord. - Lear. The King would speak with Cornwall; the dear father - Would with his daughter speak, commands her service. - Are they inform'd of this? My breath and blood! - Fiery? the fiery Duke? Tell the hot Duke that- - No, but not yet! May be he is not well. - Infirmity doth still neglect all office - Whereto our health is bound. We are not ourselves - When nature, being oppress'd, commands the mind - To suffer with the body. I'll forbear; - And am fallen out with my more headier will, - To take the indispos'd and sickly fit - For the sound man.- Death on my state! Wherefore - Should be sit here? This act persuades me - That this remotion of the Duke and her - Is practice only. Give me my servant forth. - Go tell the Duke and 's wife I'ld speak with them- - Now, presently. Bid them come forth and hear me, - Or at their chamber door I'll beat the drum - Till it cry sleep to death. - Glou. I would have all well betwixt you. Exit. - Lear. O me, my heart, my rising heart! But down! - Fool. Cry to it, nuncle, as the cockney did to the eels when -she - put 'em i' th' paste alive. She knapp'd 'em o' th' coxcombs -with - a stick and cried 'Down, wantons, down!' 'Twas her brother -that, - in pure kindness to his horse, buttered his hay. - - Enter Cornwall, Regan, Gloucester, Servants. - - Lear. Good morrow to you both. - Corn. Hail to your Grace! - Kent here set at liberty. - Reg. I am glad to see your Highness. - Lear. Regan, I think you are; I know what reason - I have to think so. If thou shouldst not be glad, - I would divorce me from thy mother's tomb, - Sepulchring an adultress. [To Kent] O, are you free? - Some other time for that.- Beloved Regan, - Thy sister's naught. O Regan, she hath tied - Sharp-tooth'd unkindness, like a vulture, here! - [Lays his hand on his heart.] - I can scarce speak to thee. Thou'lt not believe - With how deprav'd a quality- O Regan! - Reg. I pray you, sir, take patience. I have hope - You less know how to value her desert - Than she to scant her duty. - Lear. Say, how is that? - Reg. I cannot think my sister in the least - Would fail her obligation. If, sir, perchance - She have restrain'd the riots of your followers, - 'Tis on such ground, and to such wholesome end, - As clears her from all blame. - Lear. My curses on her! - Reg. O, sir, you are old! - Nature in you stands on the very verge - Of her confine. You should be rul'd, and led - By some discretion that discerns your state - Better than you yourself. Therefore I pray you - That to our sister you do make return; - Say you have wrong'd her, sir. - Lear. Ask her forgiveness? - Do you but mark how this becomes the house: - 'Dear daughter, I confess that I am old. [Kneels.] - Age is unnecessary. On my knees I beg - That you'll vouchsafe me raiment, bed, and food.' - Reg. Good sir, no more! These are unsightly tricks. - Return you to my sister. - Lear. [rises] Never, Regan! - She hath abated me of half my train; - Look'd black upon me; struck me with her tongue, - Most serpent-like, upon the very heart. - All the stor'd vengeances of heaven fall - On her ingrateful top! Strike her young bones, - You taking airs, with lameness! - Corn. Fie, sir, fie! - Lear. You nimble lightnings, dart your blinding flames - Into her scornful eyes! Infect her beauty, - You fen-suck'd fogs, drawn by the pow'rful sun, - To fall and blast her pride! - Reg. O the blest gods! so will you wish on me - When the rash mood is on. - Lear. No, Regan, thou shalt never have my curse. - Thy tender-hefted nature shall not give - Thee o'er to harshness. Her eyes are fierce; but thine - Do comfort, and not burn. 'Tis not in thee - To grudge my pleasures, to cut off my train, - To bandy hasty words, to scant my sizes, - And, in conclusion, to oppose the bolt - Against my coming in. Thou better know'st - The offices of nature, bond of childhood, - Effects of courtesy, dues of gratitude. - Thy half o' th' kingdom hast thou not forgot, - Wherein I thee endow'd. - Reg. Good sir, to th' purpose. - Tucket within. - Lear. Who put my man i' th' stocks? - Corn. What trumpet's that? - Reg. I know't- my sister's. This approves her letter, - That she would soon be here. - - Enter [Oswald the] Steward. - - Is your lady come? - Lear. This is a slave, whose easy-borrowed pride - Dwells in the fickle grace of her he follows. - Out, varlet, from my sight! - Corn. What means your Grace? - - Enter Goneril. - - Lear. Who stock'd my servant? Regan, I have good hope - Thou didst not know on't.- Who comes here? O heavens! - If you do love old men, if your sweet sway - Allow obedience- if yourselves are old, - Make it your cause! Send down, and take my part! - [To Goneril] Art not asham'd to look upon this beard?- - O Regan, wilt thou take her by the hand? - Gon. Why not by th' hand, sir? How have I offended? - All's not offence that indiscretion finds - And dotage terms so. - Lear. O sides, you are too tough! - Will you yet hold? How came my man i' th' stocks? - Corn. I set him there, sir; but his own disorders - Deserv'd much less advancement. - Lear. You? Did you? - Reg. I pray you, father, being weak, seem so. - If, till the expiration of your month, - You will return and sojourn with my sister, - Dismissing half your train, come then to me. - I am now from home, and out of that provision - Which shall be needful for your entertainment. - Lear. Return to her, and fifty men dismiss'd? - No, rather I abjure all roofs, and choose - To wage against the enmity o' th' air, - To be a comrade with the wolf and owl- - Necessity's sharp pinch! Return with her? - Why, the hot-blooded France, that dowerless took - Our youngest born, I could as well be brought - To knee his throne, and, squire-like, pension beg - To keep base life afoot. Return with her? - Persuade me rather to be slave and sumpter - To this detested groom. [Points at Oswald.] - Gon. At your choice, sir. - Lear. I prithee, daughter, do not make me mad. - I will not trouble thee, my child; farewell. - We'll no more meet, no more see one another. - But yet thou art my flesh, my blood, my daughter; - Or rather a disease that's in my flesh, - Which I must needs call mine. Thou art a boil, - A plague sore, an embossed carbuncle - In my corrupted blood. But I'll not chide thee. - Let shame come when it will, I do not call it. - I do not bid the Thunder-bearer shoot - Nor tell tales of thee to high-judging Jove. - Mend when thou canst; be better at thy leisure; - I can be patient, I can stay with Regan, - I and my hundred knights. - Reg. Not altogether so. - I look'd not for you yet, nor am provided - For your fit welcome. Give ear, sir, to my sister; - For those that mingle reason with your passion - Must be content to think you old, and so- - But she knows what she does. - Lear. Is this well spoken? - Reg. I dare avouch it, sir. What, fifty followers? - Is it not well? What should you need of more? - Yea, or so many, sith that both charge and danger - Speak 'gainst so great a number? How in one house - Should many people, under two commands, - Hold amity? 'Tis hard; almost impossible. - Gon. Why might not you, my lord, receive attendance - From those that she calls servants, or from mine? - Reg. Why not, my lord? If then they chanc'd to slack ye, - We could control them. If you will come to me - (For now I spy a danger), I entreat you - To bring but five-and-twenty. To no more - Will I give place or notice. - Lear. I gave you all- - Reg. And in good time you gave it! - Lear. Made you my guardians, my depositaries; - But kept a reservation to be followed - With such a number. What, must I come to you - With five-and-twenty, Regan? Said you so? - Reg. And speak't again my lord. No more with me. - Lear. Those wicked creatures yet do look well-favour'd - When others are more wicked; not being the worst - Stands in some rank of praise. [To Goneril] I'll go with -thee. - Thy fifty yet doth double five-and-twenty, - And thou art twice her love. - Gon. Hear, me, my lord. - What need you five-and-twenty, ten, or five, - To follow in a house where twice so many - Have a command to tend you? - Reg. What need one? - Lear. O, reason not the need! Our basest beggars - Are in the poorest thing superfluous. - Allow not nature more than nature needs, - Man's life is cheap as beast's. Thou art a lady: - If only to go warm were gorgeous, - Why, nature needs not what thou gorgeous wear'st - Which scarcely keeps thee warm. But, for true need- - You heavens, give me that patience, patience I need! - You see me here, you gods, a poor old man, - As full of grief as age; wretched in both. - If it be you that stirs these daughters' hearts - Against their father, fool me not so much - To bear it tamely; touch me with noble anger, - And let not women's weapons, water drops, - Stain my man's cheeks! No, you unnatural hags! - I will have such revenges on you both - That all the world shall- I will do such things- - What they are yet, I know not; but they shall be - The terrors of the earth! You think I'll weep. - No, I'll not weep. - I have full cause of weeping, but this heart - Shall break into a hundred thousand flaws - Or ere I'll weep. O fool, I shall go mad! - Exeunt Lear, Gloucester, Kent, and Fool. Storm and - tempest. - Corn. Let us withdraw; 'twill be a storm. - Reg. This house is little; the old man and 's people - Cannot be well bestow'd. - Gon. 'Tis his own blame; hath put himself from rest - And must needs taste his folly. - Reg. For his particular, I'll receive him gladly, - But not one follower. - Gon. So am I purpos'd. - Where is my Lord of Gloucester? - Corn. Followed the old man forth. - - Enter Gloucester. - - He is return'd. - Glou. The King is in high rage. - Corn. Whither is he going? - Glou. He calls to horse, but will I know not whither. - Corn. 'Tis best to give him way; he leads himself. - Gon. My lord, entreat him by no means to stay. - Glou. Alack, the night comes on, and the bleak winds - Do sorely ruffle. For many miles about - There's scarce a bush. - Reg. O, sir, to wilful men - The injuries that they themselves procure - Must be their schoolmasters. Shut up your doors. - He is attended with a desperate train, - And what they may incense him to, being apt - To have his ear abus'd, wisdom bids fear. - Corn. Shut up your doors, my lord: 'tis a wild night. - My Regan counsels well. Come out o' th' storm. -[Exeunt.] - - - - -<> - - - -ACT III. Scene I. -A heath. - -Storm still. Enter Kent and a Gentleman at several doors. - - Kent. Who's there, besides foul weather? - Gent. One minded like the weather, most unquietly. - Kent. I know you. Where's the King? - Gent. Contending with the fretful elements; - Bids the wind blow the earth into the sea, - Or swell the curled waters 'bove the main, - That things might change or cease; tears his white hair, - Which the impetuous blasts, with eyeless rage, - Catch in their fury and make nothing of; - Strives in his little world of man to outscorn - The to-and-fro-conflicting wind and rain. - This night, wherein the cub-drawn bear would couch, - The lion and the belly-pinched wolf - Keep their fur dry, unbonneted he runs, - And bids what will take all. - Kent. But who is with him? - Gent. None but the fool, who labours to outjest - His heart-struck injuries. - Kent. Sir, I do know you, - And dare upon the warrant of my note - Command a dear thing to you. There is division - (Although as yet the face of it be cover'd - With mutual cunning) 'twixt Albany and Cornwall; - Who have (as who have not, that their great stars - Thron'd and set high?) servants, who seem no less, - Which are to France the spies and speculations - Intelligent of our state. What hath been seen, - Either in snuffs and packings of the Dukes, - Or the hard rein which both of them have borne - Against the old kind King, or something deeper, - Whereof, perchance, these are but furnishings- - But, true it is, from France there comes a power - Into this scattered kingdom, who already, - Wise in our negligence, have secret feet - In some of our best ports and are at point - To show their open banner. Now to you: - If on my credit you dare build so far - To make your speed to Dover, you shall find - Some that will thank you, making just report - Of how unnatural and bemadding sorrow - The King hath cause to plain. - I am a gentleman of blood and breeding, - And from some knowledge and assurance offer - This office to you. - Gent. I will talk further with you. - Kent. No, do not. - For confirmation that I am much more - Than my out-wall, open this purse and take - What it contains. If you shall see Cordelia - (As fear not but you shall), show her this ring, - And she will tell you who your fellow is - That yet you do not know. Fie on this storm! - I will go seek the King. - Gent. Give me your hand. Have you no more to say? - Kent. Few words, but, to effect, more than all yet: - That, when we have found the King (in which your pain - That way, I'll this), he that first lights on him - Holla the other. - Exeunt [severally]. - - - - -Scene II. -Another part of the heath. - -Storm still. Enter Lear and Fool. - - Lear. Blow, winds, and crack your cheeks! rage! blow! - You cataracts and hurricanoes, spout - Till you have drench'd our steeples, drown'd the cocks! - You sulph'rous and thought-executing fires, - Vaunt-couriers to oak-cleaving thunderbolts, - Single my white head! And thou, all-shaking thunder, - Strike flat the thick rotundity o' th' world, - Crack Nature's moulds, all germains spill at once, - That makes ingrateful man! - Fool. O nuncle, court holy water in a dry house is better than -this - rain water out o' door. Good nuncle, in, and ask thy -daughters - blessing! Here's a night pities nether wise men nor fools. - Lear. Rumble thy bellyful! Spit, fire! spout, rain! - Nor rain, wind, thunder, fire are my daughters. - I tax not you, you elements, with unkindness. - I never gave you kingdom, call'd you children, - You owe me no subscription. Then let fall - Your horrible pleasure. Here I stand your slave, - A poor, infirm, weak, and despis'd old man. - But yet I call you servile ministers, - That will with two pernicious daughters join - Your high-engender'd battles 'gainst a head - So old and white as this! O! O! 'tis foul! - Fool. He that has a house to put 's head in has a good -head-piece. - The codpiece that will house - Before the head has any, - The head and he shall louse: - So beggars marry many. - The man that makes his toe - What he his heart should make - Shall of a corn cry woe, - And turn his sleep to wake. - For there was never yet fair woman but she made mouths in a - glass. - - Enter Kent. - - Lear. No, I will be the pattern of all patience; - I will say nothing. - Kent. Who's there? - Fool. Marry, here's grace and a codpiece; that's a wise man and -a - fool. - Kent. Alas, sir, are you here? Things that love night - Love not such nights as these. The wrathful skies - Gallow the very wanderers of the dark - And make them keep their caves. Since I was man, - Such sheets of fire, such bursts of horrid thunder, - Such groans of roaring wind and rain, I never - Remember to have heard. Man's nature cannot carry - Th' affliction nor the fear. - Lear. Let the great gods, - That keep this dreadful pudder o'er our heads, - Find out their enemies now. Tremble, thou wretch, - That hast within thee undivulged crimes - Unwhipp'd of justice. Hide thee, thou bloody hand; - Thou perjur'd, and thou simular man of virtue - That art incestuous. Caitiff, in pieces shake - That under convert and convenient seeming - Hast practis'd on man's life. Close pent-up guilts, - Rive your concealing continents, and cry - These dreadful summoners grace. I am a man - More sinn'd against than sinning. - Kent. Alack, bareheaded? - Gracious my lord, hard by here is a hovel; - Some friendship will it lend you 'gainst the tempest. - Repose you there, whilst I to this hard house - (More harder than the stones whereof 'tis rais'd, - Which even but now, demanding after you, - Denied me to come in) return, and force - Their scanted courtesy. - Lear. My wits begin to turn. - Come on, my boy. How dost, my boy? Art cold? - I am cold myself. Where is this straw, my fellow? - The art of our necessities is strange, - That can make vile things precious. Come, your hovel. - Poor fool and knave, I have one part in my heart - That's sorry yet for thee. - Fool. [sings] - - He that has and a little tiny wit- - With hey, ho, the wind and the rain- - Must make content with his fortunes fit, - For the rain it raineth every day. - - Lear. True, my good boy. Come, bring us to this hovel. - Exeunt [Lear and Kent]. - Fool. This is a brave night to cool a courtesan. I'll speak a - prophecy ere I go: - When priests are more in word than matter; - When brewers mar their malt with water; - When nobles are their tailors' tutors, - No heretics burn'd, but wenches' suitors; - When every case in law is right, - No squire in debt nor no poor knight; - When slanders do not live in tongues, - Nor cutpurses come not to throngs; - When usurers tell their gold i' th' field, - And bawds and whores do churches build: - Then shall the realm of Albion - Come to great confusion. - Then comes the time, who lives to see't, - That going shall be us'd with feet. - This prophecy Merlin shall make, for I live before his time. -Exit. - - - - -Scene III. -Gloucester's Castle. - -Enter Gloucester and Edmund. - - Glou. Alack, alack, Edmund, I like not this unnatural dealing! -When - I desir'd their leave that I might pity him, they took from -me - the use of mine own house, charg'd me on pain of perpetual - displeasure neither to speak of him, entreat for him, nor -any - way sustain him. - Edm. Most savage and unnatural! - Glou. Go to; say you nothing. There is division betwixt the -Dukes, - and a worse matter than that. I have received a letter this - night- 'tis dangerous to be spoken- I have lock'd the letter -in - my closet. These injuries the King now bears will be -revenged - home; there's part of a power already footed; we must -incline to - the King. I will seek him and privily relieve him. Go you -and - maintain talk with the Duke, that my charity be not of him - perceived. If he ask for me, I am ill and gone to bed. -Though I - die for't, as no less is threat'ned me, the King my old -master - must be relieved. There is some strange thing toward, -Edmund. - Pray you be careful. Exit. - Edm. This courtesy, forbid thee, shall the Duke - Instantly know, and of that letter too. - This seems a fair deserving, and must draw me - That which my father loses- no less than all. - The younger rises when the old doth fall. Exit. - - - - -Scene IV. -The heath. Before a hovel. - -Storm still. Enter Lear, Kent, and Fool. - - Kent. Here is the place, my lord. Good my lord, enter. - The tyranny of the open night 's too rough - For nature to endure. - Lear. Let me alone. - Kent. Good my lord, enter here. - Lear. Wilt break my heart? - Kent. I had rather break mine own. Good my lord, enter. - Lear. Thou think'st 'tis much that this contentious storm - Invades us to the skin. So 'tis to thee; - But where the greater malady is fix'd, - The lesser is scarce felt. Thou'dst shun a bear; - But if thy flight lay toward the raging sea, - Thou'dst meet the bear i' th' mouth. When the mind's free, - The body's delicate. The tempest in my mind - Doth from my senses take all feeling else - Save what beats there. Filial ingratitude! - Is it not as this mouth should tear this hand - For lifting food to't? But I will punish home! - No, I will weep no more. In such a night - 'To shut me out! Pour on; I will endure. - In such a night as this! O Regan, Goneril! - Your old kind father, whose frank heart gave all! - O, that way madness lies; let me shun that! - No more of that. - Kent. Good my lord, enter here. - Lear. Prithee go in thyself; seek thine own ease. - This tempest will not give me leave to ponder - On things would hurt me more. But I'll go in. - [To the Fool] In, boy; go first.- You houseless poverty- - Nay, get thee in. I'll pray, and then I'll sleep. - Exit [Fool]. - Poor naked wretches, wheresoe'er you are, - That bide the pelting of this pitiless storm, - How shall your houseless heads and unfed sides, - Your loop'd and window'd raggedness, defend you - From seasons such as these? O, I have ta'en - Too little care of this! Take physic, pomp; - Expose thyself to feel what wretches feel, - That thou mayst shake the superflux to them - And show the heavens more just. - Edg. [within] Fathom and half, fathom and half! Poor Tom! - - Enter Fool [from the hovel]. - - Fool. Come not in here, nuncle, here's a spirit. Help me, help -me! - Kent. Give me thy hand. Who's there? - Fool. A spirit, a spirit! He says his name's poor Tom. - Kent. What art thou that dost grumble there i' th' straw? - Come forth. - - Enter Edgar [disguised as a madman]. - - Edg. Away! the foul fiend follows me! Through the sharp -hawthorn - blows the cold wind. Humh! go to thy cold bed, and warm -thee. - Lear. Hast thou given all to thy two daughters, and art thou -come - to this? - Edg. Who gives anything to poor Tom? whom the foul fiend hath -led - through fire and through flame, through ford and whirlpool, -o'er - bog and quagmire; that hath laid knives under his pillow and - halters in his pew, set ratsbane by his porridge, made him -proud - of heart, to ride on a bay trotting horse over four-inch'd - bridges, to course his own shadow for a traitor. Bless thy -five - wits! Tom 's acold. O, do de, do de, do de. Bless thee from - whirlwinds, star-blasting, and taking! Do poor Tom some -charity, - whom the foul fiend vexes. There could I have him now- and -there- - and there again- and there! - Storm still. - Lear. What, have his daughters brought him to this pass? - Couldst thou save nothing? Didst thou give 'em all? - Fool. Nay, he reserv'd a blanket, else we had been all sham'd. - Lear. Now all the plagues that in the pendulous air - Hang fated o'er men's faults light on thy daughters! - Kent. He hath no daughters, sir. - Lear. Death, traitor! nothing could have subdu'd nature - To such a lowness but his unkind daughters. - Is it the fashion that discarded fathers - Should have thus little mercy on their flesh? - Judicious punishment! 'Twas this flesh begot - Those pelican daughters. - Edg. Pillicock sat on Pillicock's Hill. 'Allow, 'allow, loo, -loo! - Fool. This cold night will turn us all to fools and madmen. - Edg. Take heed o' th' foul fiend; obey thy parents: keep thy -word - justly; swear not; commit not with man's sworn spouse; set -not - thy sweet heart on proud array. Tom 's acold. - Lear. What hast thou been? - Edg. A servingman, proud in heart and mind; that curl'd my -hair, - wore gloves in my cap; serv'd the lust of my mistress' heart -and - did the act of darkness with her; swore as many oaths as I -spake - words, and broke them in the sweet face of heaven; one that - slept in the contriving of lust, and wak'd to do it. Wine -lov'd - I deeply, dice dearly; and in woman out-paramour'd the Turk. - False of heart, light of ear, bloody of hand; hog in sloth, -fox - in stealth, wolf in greediness, dog in madness, lion in -prey. - Let not the creaking of shoes nor the rustling of silks -betray - thy poor heart to woman. Keep thy foot out of brothel, thy -hand - out of placket, thy pen from lender's book, and defy the -foul - fiend. Still through the hawthorn blows the cold wind; says - suum, mun, hey, no, nonny. Dolphin my boy, my boy, sessa! -let - him trot by. - Storm still. - Lear. Why, thou wert better in thy grave than to answer with -thy - uncover'd body this extremity of the skies. Is man no more -than - this? Consider him well. Thou ow'st the worm no silk, the -beast - no hide, the sheep no wool, the cat no perfume. Ha! Here's -three - on's are sophisticated! Thou art the thing itself; - unaccommodated man is no more but such a poor, bare, forked - animal as thou art. Off, off, you lendings! Come, unbutton - here. - [Tears at his clothes.] - Fool. Prithee, nuncle, be contented! 'Tis a naughty night to -swim - in. Now a little fire in a wild field were like an old -lecher's - heart- a small spark, all the rest on's body cold. Look, -here - comes a walking fire. - - Enter Gloucester with a torch. - - Edg. This is the foul fiend Flibbertigibbet. He begins at -curfew, - and walks till the first cock. He gives the web and the pin, - squints the eye, and makes the harelip; mildews the white -wheat, - and hurts the poor creature of earth. - - Saint Withhold footed thrice the 'old; - He met the nightmare, and her nine fold; - Bid her alight - And her troth plight, - And aroint thee, witch, aroint thee! - - Kent. How fares your Grace? - Lear. What's he? - Kent. Who's there? What is't you seek? - Glou. What are you there? Your names? - Edg. Poor Tom, that eats the swimming frog, the toad, the -todpole, - the wall-newt and the water; that in the fury of his heart, -when - the foul fiend rages, eats cow-dung for sallets, swallows -the - old rat and the ditch-dog, drinks the green mantle of the - standing pool; who is whipp'd from tithing to tithing, and - stock-punish'd and imprison'd; who hath had three suits to -his - back, six shirts to his body, horse to ride, and weapons to - wear; - - But mice and rats, and such small deer, - Have been Tom's food for seven long year. - - Beware my follower. Peace, Smulkin! peace, thou fiend! - Glou. What, hath your Grace no better company? - Edg. The prince of darkness is a gentleman! - Modo he's call'd, and Mahu. - Glou. Our flesh and blood is grown so vile, my lord, - That it doth hate what gets it. - Edg. Poor Tom 's acold. - Glou. Go in with me. My duty cannot suffer - T' obey in all your daughters' hard commands. - Though their injunction be to bar my doors - And let this tyrannous night take hold upon you, - Yet have I ventur'd to come seek you out - And bring you where both fire and food is ready. - Lear. First let me talk with this philosopher. - What is the cause of thunder? - Kent. Good my lord, take his offer; go into th' house. - Lear. I'll talk a word with this same learned Theban. - What is your study? - Edg. How to prevent the fiend and to kill vermin. - Lear. Let me ask you one word in private. - Kent. Importune him once more to go, my lord. - His wits begin t' unsettle. - Glou. Canst thou blame him? - Storm still. - His daughters seek his death. Ah, that good Kent! - He said it would be thus- poor banish'd man! - Thou say'st the King grows mad: I'll tell thee, friend, - I am almost mad myself. I had a son, - Now outlaw'd from my blood. He sought my life - But lately, very late. I lov'd him, friend- - No father his son dearer. True to tell thee, - The grief hath craz'd my wits. What a night 's this! - I do beseech your Grace- - Lear. O, cry you mercy, sir. - Noble philosopher, your company. - Edg. Tom's acold. - Glou. In, fellow, there, into th' hovel; keep thee warm. - Lear. Come, let's in all. - Kent. This way, my lord. - Lear. With him! - I will keep still with my philosopher. - Kent. Good my lord, soothe him; let him take the fellow. - Glou. Take him you on. - Kent. Sirrah, come on; go along with us. - Lear. Come, good Athenian. - Glou. No words, no words! hush. - Edg. Child Rowland to the dark tower came; - His word was still - - Fie, foh, and fum! - I smell the blood of a British man. - Exeunt. - -Scene V. -Gloucester's Castle. - -Enter Cornwall and Edmund. - - Corn. I will have my revenge ere I depart his house. - Edm. How, my lord, I may be censured, that nature thus gives -way to - loyalty, something fears me to think of. - Corn. I now perceive it was not altogether your brother's evil - disposition made him seek his death; but a provoking merit, -set - awork by a reproveable badness in himself. - Edm. How malicious is my fortune that I must repent to be just! - This is the letter he spoke of, which approves him an - intelligent party to the advantages of France. O heavens! -that - this treason were not- or not I the detector! - Corn. Go with me to the Duchess. - Edm. If the matter of this paper be certain, you have mighty - business in hand. - Corn. True or false, it hath made thee Earl of Gloucester. - Seek out where thy father is, that he may be ready for our - apprehension. - Edm. [aside] If I find him comforting the King, it will stuff -his - suspicion more fully.- I will persever in my course of -loyalty, - though the conflict be sore between that and my blood. - Corn. I will lay trust upon thee, and thou shalt find a dearer - father in my love. - Exeunt. - - - - -Scene VI. -A farmhouse near Gloucester's Castle. - -Enter Gloucester, Lear, Kent, Fool, and Edgar. - - Glou. Here is better than the open air; take it thankfully. I -will - piece out the comfort with what addition I can. I will not -be - long from you. - Kent. All the power of his wits have given way to his -impatience. - The gods reward your kindness! - Exit [Gloucester]. - Edg. Frateretto calls me, and tells me Nero is an angler in the - lake of darkness. Pray, innocent, and beware the foul fiend. - Fool. Prithee, nuncle, tell me whether a madman be a gentleman -or a - yeoman. - Lear. A king, a king! - Fool. No, he's a yeoman that has a gentleman to his son; for -he's a - mad yeoman that sees his son a gentleman before him. - Lear. To have a thousand with red burning spits - Come hizzing in upon 'em- - Edg. The foul fiend bites my back. - Fool. He's mad that trusts in the tameness of a wolf, a horse's - health, a boy's love, or a whore's oath. - Lear. It shall be done; I will arraign them straight. - [To Edgar] Come, sit thou here, most learned justicer. - [To the Fool] Thou, sapient sir, sit here. Now, you -she-foxes! - Edg. Look, where he stands and glares! Want'st thou eyes at -trial, - madam? - - Come o'er the bourn, Bessy, to me. - - Fool. Her boat hath a leak, - And she must not speak - Why she dares not come over to thee. - - Edg. The foul fiend haunts poor Tom in the voice of a -nightingale. - Hoppedance cries in Tom's belly for two white herring. Croak - not, black angel; I have no food for thee. - Kent. How do you, sir? Stand you not so amaz'd. - Will you lie down and rest upon the cushions? - Lear. I'll see their trial first. Bring in their evidence. - [To Edgar] Thou, robed man of justice, take thy place. - [To the Fool] And thou, his yokefellow of equity, - Bench by his side. [To Kent] You are o' th' commission, - Sit you too. - Edg. Let us deal justly. - - Sleepest or wakest thou, jolly shepherd? - Thy sheep be in the corn; - And for one blast of thy minikin mouth - Thy sheep shall take no harm. - - Purr! the cat is gray. - Lear. Arraign her first. 'Tis Goneril. I here take my oath -before - this honourable assembly, she kicked the poor King her -father. - Fool. Come hither, mistress. Is your name Goneril? - Lear. She cannot deny it. - Fool. Cry you mercy, I took you for a joint-stool. - Lear. And here's another, whose warp'd looks proclaim - What store her heart is made on. Stop her there! - Arms, arms! sword! fire! Corruption in the place! - False justicer, why hast thou let her scape? - Edg. Bless thy five wits! - Kent. O pity! Sir, where is the patience now - That you so oft have boasted to retain? - Edg. [aside] My tears begin to take his part so much - They'll mar my counterfeiting. - Lear. The little dogs and all, - Tray, Blanch, and Sweetheart, see, they bark at me. - Edg. Tom will throw his head at them. Avaunt, you curs! - Be thy mouth or black or white, - Tooth that poisons if it bite; - Mastiff, greyhound, mongrel grim, - Hound or spaniel, branch or lym, - Bobtail tyke or trundle-tall- - Tom will make them weep and wail; - For, with throwing thus my head, - Dogs leap the hatch, and all are fled. - Do de, de, de. Sessa! Come, march to wakes and fairs and -market - towns. Poor Tom, thy horn is dry. - Lear. Then let them anatomize Regan. See what breeds about her - heart. Is there any cause in nature that makes these hard - hearts? [To Edgar] You, sir- I entertain you for one of my - hundred; only I do not like the fashion of your garments. -You'll - say they are Persian attire; but let them be chang'd. - Kent. Now, good my lord, lie here and rest awhile. - Lear. Make no noise, make no noise; draw the curtains. - So, so, so. We'll go to supper i' th' morning. So, so, so. - Fool. And I'll go to bed at noon. - - Enter Gloucester. - - Glou. Come hither, friend. Where is the King my master? - Kent. Here, sir; but trouble him not; his wits are gone. - Glou. Good friend, I prithee take him in thy arms. - I have o'erheard a plot of death upon him. - There is a litter ready; lay him in't - And drive towards Dover, friend, where thou shalt meet - Both welcome and protection. Take up thy master. - If thou shouldst dally half an hour, his life, - With thine, and all that offer to defend him, - Stand in assured loss. Take up, take up! - And follow me, that will to some provision - Give thee quick conduct. - Kent. Oppressed nature sleeps. - This rest might yet have balm'd thy broken senses, - Which, if convenience will not allow, - Stand in hard cure. [To the Fool] Come, help to bear thy -master. - Thou must not stay behind. - Glou. Come, come, away! - Exeunt [all but Edgar]. - Edg. When we our betters see bearing our woes, - We scarcely think our miseries our foes. - Who alone suffers suffers most i' th' mind, - Leaving free things and happy shows behind; - But then the mind much sufferance doth o'erskip - When grief hath mates, and bearing fellowship. - How light and portable my pain seems now, - When that which makes me bend makes the King bow, - He childed as I fathered! Tom, away! - Mark the high noises, and thyself bewray - When false opinion, whose wrong thought defiles thee, - In thy just proof repeals and reconciles thee. - What will hap more to-night, safe scape the King! - Lurk, lurk. [Exit.] - - - - -Scene VII. -Gloucester's Castle. - -Enter Cornwall, Regan, Goneril, [Edmund the] Bastard, and -Servants. - - Corn. [to Goneril] Post speedily to my lord your husband, show -him - this letter. The army of France is landed.- Seek out the -traitor - Gloucester. - [Exeunt some of the Servants.] - Reg. Hang him instantly. - Gon. Pluck out his eyes. - Corn. Leave him to my displeasure. Edmund, keep you our sister - company. The revenges we are bound to take upon your -traitorous - father are not fit for your beholding. Advise the Duke where -you - are going, to a most festinate preparation. We are bound to -the - like. Our posts shall be swift and intelligent betwixt us. - Farewell, dear sister; farewell, my Lord of Gloucester. - - Enter [Oswald the] Steward. - - How now? Where's the King? - Osw. My Lord of Gloucester hath convey'd him hence. - Some five or six and thirty of his knights, - Hot questrists after him, met him at gate; - Who, with some other of the lord's dependants, - Are gone with him towards Dover, where they boast - To have well-armed friends. - Corn. Get horses for your mistress. - Gon. Farewell, sweet lord, and sister. - Corn. Edmund, farewell. - Exeunt Goneril, [Edmund, and Oswald]. - Go seek the traitor Gloucester, - Pinion him like a thief, bring him before us. - [Exeunt other Servants.] - Though well we may not pass upon his life - Without the form of justice, yet our power - Shall do a court'sy to our wrath, which men - May blame, but not control. - - Enter Gloucester, brought in by two or three. - - Who's there? the traitor? - Reg. Ingrateful fox! 'tis he. - Corn. Bind fast his corky arms. - Glou. What mean, your Graces? Good my friends, consider - You are my guests. Do me no foul play, friends. - Corn. Bind him, I say. - [Servants bind him.] - Reg. Hard, hard. O filthy traitor! - Glou. Unmerciful lady as you are, I am none. - Corn. To this chair bind him. Villain, thou shalt find- - [Regan plucks his beard.] - Glou. By the kind gods, 'tis most ignobly done - To pluck me by the beard. - Reg. So white, and such a traitor! - Glou. Naughty lady, - These hairs which thou dost ravish from my chin - Will quicken, and accuse thee. I am your host. - With robber's hands my hospitable favours - You should not ruffle thus. What will you do? - Corn. Come, sir, what letters had you late from France? - Reg. Be simple-answer'd, for we know the truth. - Corn. And what confederacy have you with the traitors - Late footed in the kingdom? - Reg. To whose hands have you sent the lunatic King? - Speak. - Glou. I have a letter guessingly set down, - Which came from one that's of a neutral heart, - And not from one oppos'd. - Corn. Cunning. - Reg. And false. - Corn. Where hast thou sent the King? - Glou. To Dover. - Reg. Wherefore to Dover? Wast thou not charg'd at peril- - Corn. Wherefore to Dover? Let him first answer that. - Glou. I am tied to th' stake, and I must stand the course. - Reg. Wherefore to Dover, sir? - Glou. Because I would not see thy cruel nails - Pluck out his poor old eyes; nor thy fierce sister - In his anointed flesh stick boarish fangs. - The sea, with such a storm as his bare head - In hell-black night endur'd, would have buoy'd up - And quench'd the steeled fires. - Yet, poor old heart, he holp the heavens to rain. - If wolves had at thy gate howl'd that stern time, - Thou shouldst have said, 'Good porter, turn the key.' - All cruels else subscrib'd. But I shall see - The winged vengeance overtake such children. - Corn. See't shalt thou never. Fellows, hold the chair. - Upon these eyes of thine I'll set my foot. - Glou. He that will think to live till he be old, - Give me some help!- O cruel! O ye gods! - Reg. One side will mock another. Th' other too! - Corn. If you see vengeance- - 1. Serv. Hold your hand, my lord! - I have serv'd you ever since I was a child; - But better service have I never done you - Than now to bid you hold. - Reg. How now, you dog? - 1. Serv. If you did wear a beard upon your chin, - I'ld shake it on this quarrel. - Reg. What do you mean? - Corn. My villain! Draw and fight. - 1. Serv. Nay, then, come on, and take the chance of anger. - Reg. Give me thy sword. A peasant stand up thus? - She takes a sword and runs at him behind. - 1. Serv. O, I am slain! My lord, you have one eye left - To see some mischief on him. O! He dies. - Corn. Lest it see more, prevent it. Out, vile jelly! - Where is thy lustre now? - Glou. All dark and comfortless! Where's my son Edmund? - Edmund, enkindle all the sparks of nature - To quit this horrid act. - Reg. Out, treacherous villain! - Thou call'st on him that hates thee. It was he - That made the overture of thy treasons to us; - Who is too good to pity thee. - Glou. O my follies! Then Edgar was abus'd. - Kind gods, forgive me that, and prosper him! - Reg. Go thrust him out at gates, and let him smell - His way to Dover. - Exit [one] with Gloucester. - How is't, my lord? How look you? - Corn. I have receiv'd a hurt. Follow me, lady. - Turn out that eyeless villain. Throw this slave - Upon the dunghill. Regan, I bleed apace. - Untimely comes this hurt. Give me your arm. - Exit [Cornwall, led by Regan]. - 2. Serv. I'll never care what wickedness I do, - If this man come to good. - 3. Serv. If she live long, - And in the end meet the old course of death, - Women will all turn monsters. - 2. Serv. Let's follow the old Earl, and get the bedlam - To lead him where he would. His roguish madness - Allows itself to anything. - 3. Serv. Go thou. I'll fetch some flax and whites of eggs - To apply to his bleeding face. Now heaven help him! - Exeunt. - - - - -<> - - - -ACT IV. Scene I. -The heath. - -Enter Edgar. - - Edg. Yet better thus, and known to be contemn'd, - Than still contemn'd and flatter'd. To be worst, - The lowest and most dejected thing of fortune, - Stands still in esperance, lives not in fear. - The lamentable change is from the best; - The worst returns to laughter. Welcome then, - Thou unsubstantial air that I embrace! - The wretch that thou hast blown unto the worst - Owes nothing to thy blasts. - - Enter Gloucester, led by an Old Man. - - But who comes here? - My father, poorly led? World, world, O world! - But that thy strange mutations make us hate thee, - Life would not yield to age. - Old Man. O my good lord, - I have been your tenant, and your father's tenant, - These fourscore years. - Glou. Away, get thee away! Good friend, be gone. - Thy comforts can do me no good at all; - Thee they may hurt. - Old Man. You cannot see your way. - Glou. I have no way, and therefore want no eyes; - I stumbled when I saw. Full oft 'tis seen - Our means secure us, and our mere defects - Prove our commodities. Ah dear son Edgar, - The food of thy abused father's wrath! - Might I but live to see thee in my touch, - I'ld say I had eyes again! - Old Man. How now? Who's there? - Edg. [aside] O gods! Who is't can say 'I am at the worst'? - I am worse than e'er I was. - Old Man. 'Tis poor mad Tom. - Edg. [aside] And worse I may be yet. The worst is not - So long as we can say 'This is the worst.' - Old Man. Fellow, where goest? - Glou. Is it a beggarman? - Old Man. Madman and beggar too. - Glou. He has some reason, else he could not beg. - I' th' last night's storm I such a fellow saw, - Which made me think a man a worm. My son - Came then into my mind, and yet my mind - Was then scarce friends with him. I have heard more since. - As flies to wanton boys are we to th' gods. - They kill us for their sport. - Edg. [aside] How should this be? - Bad is the trade that must play fool to sorrow, - Ang'ring itself and others.- Bless thee, master! - Glou. Is that the naked fellow? - Old Man. Ay, my lord. - Glou. Then prithee get thee gone. If for my sake - Thou wilt o'ertake us hence a mile or twain - I' th' way toward Dover, do it for ancient love; - And bring some covering for this naked soul, - Who I'll entreat to lead me. - Old Man. Alack, sir, he is mad! - Glou. 'Tis the time's plague when madmen lead the blind. - Do as I bid thee, or rather do thy pleasure. - Above the rest, be gone. - Old Man. I'll bring him the best 'parel that I have, - Come on't what will. Exit. - Glou. Sirrah naked fellow- - Edg. Poor Tom's acold. [Aside] I cannot daub it further. - Glou. Come hither, fellow. - Edg. [aside] And yet I must.- Bless thy sweet eyes, they bleed. - Glou. Know'st thou the way to Dover? - Edg. Both stile and gate, horseway and footpath. Poor Tom hath -been - scar'd out of his good wits. Bless thee, good man's son, -from - the foul fiend! Five fiends have been in poor Tom at once: -of - lust, as Obidicut; Hobbididence, prince of dumbness; Mahu, -of - stealing; Modo, of murder; Flibbertigibbet, of mopping and - mowing, who since possesses chambermaids and waiting women. -So, - bless thee, master! - Glou. Here, take this Purse, thou whom the heavens' plagues - Have humbled to all strokes. That I am wretched - Makes thee the happier. Heavens, deal so still! - Let the superfluous and lust-dieted man, - That slaves your ordinance, that will not see - Because he does not feel, feel your pow'r quickly; - So distribution should undo excess, - And each man have enough. Dost thou know Dover? - Edg. Ay, master. - Glou. There is a cliff, whose high and bending head - Looks fearfully in the confined deep. - Bring me but to the very brim of it, - And I'll repair the misery thou dost bear - With something rich about me. From that place - I shall no leading need. - Edg. Give me thy arm. - Poor Tom shall lead thee. - Exeunt. - - - - -Scene II. -Before the Duke of Albany's Palace. - -Enter Goneril and [Edmund the] Bastard. - - Gon. Welcome, my lord. I marvel our mild husband - Not met us on the way. - - Enter [Oswald the] Steward. - - Now, where's your master? - Osw. Madam, within, but never man so chang'd. - I told him of the army that was landed: - He smil'd at it. I told him you were coming: - His answer was, 'The worse.' Of Gloucester's treachery - And of the loyal service of his son - When I inform'd him, then he call'd me sot - And told me I had turn'd the wrong side out. - What most he should dislike seems pleasant to him; - What like, offensive. - Gon. [to Edmund] Then shall you go no further. - It is the cowish terror of his spirit, - That dares not undertake. He'll not feel wrongs - Which tie him to an answer. Our wishes on the way - May prove effects. Back, Edmund, to my brother. - Hasten his musters and conduct his pow'rs. - I must change arms at home and give the distaff - Into my husband's hands. This trusty servant - Shall pass between us. Ere long you are like to hear - (If you dare venture in your own behalf) - A mistress's command. Wear this. [Gives a favour.] - Spare speech. - Decline your head. This kiss, if it durst speak, - Would stretch thy spirits up into the air. - Conceive, and fare thee well. - Edm. Yours in the ranks of death! Exit. - Gon. My most dear Gloucester! - O, the difference of man and man! - To thee a woman's services are due; - My fool usurps my body. - Osw. Madam, here comes my lord. Exit. - - Enter Albany. - - Gon. I have been worth the whistle. - Alb. O Goneril, - You are not worth the dust which the rude wind - Blows in your face! I fear your disposition. - That nature which contemns it origin - Cannot be bordered certain in itself. - She that herself will sliver and disbranch - From her material sap, perforce must whether - And come to deadly use. - Gon. No more! The text is foolish. - Alb. Wisdom and goodness to the vile seem vile; - Filths savour but themselves. What have you done? - Tigers, not daughters, what have you perform'd? - A father, and a gracious aged man, - Whose reverence even the head-lugg'd bear would lick, - Most barbarous, most degenerate, have you madded. - Could my good brother suffer you to do it? - A man, a prince, by him so benefited! - If that the heavens do not their visible spirits - Send quickly down to tame these vile offences, - It will come, - Humanity must perforce prey on itself, - Like monsters of the deep. - Gon. Milk-liver'd man! - That bear'st a cheek for blows, a head for wrongs; - Who hast not in thy brows an eye discerning - Thine honour from thy suffering; that not know'st - Fools do those villains pity who are punish'd - Ere they have done their mischief. Where's thy drum? - France spreads his banners in our noiseless land, - With plumed helm thy state begins to threat, - Whiles thou, a moral fool, sit'st still, and criest - 'Alack, why does he so?' - Alb. See thyself, devil! - Proper deformity seems not in the fiend - So horrid as in woman. - Gon. O vain fool! - Alb. Thou changed and self-cover'd thing, for shame! - Bemonster not thy feature! Were't my fitness - To let these hands obey my blood, - They are apt enough to dislocate and tear - Thy flesh and bones. Howe'er thou art a fiend, - A woman's shape doth shield thee. - Gon. Marry, your manhood mew! - - Enter a Gentleman. - - Alb. What news? - Gent. O, my good lord, the Duke of Cornwall 's dead, - Slain by his servant, going to put out - The other eye of Gloucester. - Alb. Gloucester's eyes? - Gent. A servant that he bred, thrill'd with remorse, - Oppos'd against the act, bending his sword - To his great master; who, thereat enrag'd, - Flew on him, and amongst them fell'd him dead; - But not without that harmful stroke which since - Hath pluck'd him after. - Alb. This shows you are above, - You justicers, that these our nether crimes - So speedily can venge! But O poor Gloucester! - Lose he his other eye? - Gent. Both, both, my lord. - This letter, madam, craves a speedy answer. - 'Tis from your sister. - Gon. [aside] One way I like this well; - But being widow, and my Gloucester with her, - May all the building in my fancy pluck - Upon my hateful life. Another way - The news is not so tart.- I'll read, and answer. -Exit. - Alb. Where was his son when they did take his eyes? - Gent. Come with my lady hither. - Alb. He is not here. - Gent. No, my good lord; I met him back again. - Alb. Knows he the wickedness? - Gent. Ay, my good lord. 'Twas he inform'd against him, - And quit the house on purpose, that their punishment - Might have the freer course. - Alb. Gloucester, I live - To thank thee for the love thou show'dst the King, - And to revenge thine eyes. Come hither, friend. - Tell me what more thou know'st. - Exeunt. - - - - -Scene III. -The French camp near Dover. - -Enter Kent and a Gentleman. - - Kent. Why the King of France is so suddenly gone back know you -the - reason? - Gent. Something he left imperfect in the state, which since his - coming forth is thought of, which imports to the kingdom so -much - fear and danger that his personal return was most required -and - necessary. - Kent. Who hath he left behind him general? - Gent. The Marshal of France, Monsieur La Far. - Kent. Did your letters pierce the Queen to any demonstration of - grief? - Gent. Ay, sir. She took them, read them in my presence, - And now and then an ample tear trill'd down - Her delicate cheek. It seem'd she was a queen - Over her passion, who, most rebel-like, - Sought to be king o'er her. - Kent. O, then it mov'd her? - Gent. Not to a rage. Patience and sorrow strove - Who should express her goodliest. You have seen - Sunshine and rain at once: her smiles and tears - Were like, a better way. Those happy smilets - That play'd on her ripe lip seem'd not to know - What guests were in her eyes, which parted thence - As pearls from diamonds dropp'd. In brief, - Sorrow would be a rarity most belov'd, - If all could so become it. - Kent. Made she no verbal question? - Gent. Faith, once or twice she heav'd the name of father - Pantingly forth, as if it press'd her heart; - Cried 'Sisters, sisters! Shame of ladies! Sisters! - Kent! father! sisters! What, i' th' storm? i' th' night? - Let pity not be believ'd!' There she shook - The holy water from her heavenly eyes, - And clamour moisten'd. Then away she started - To deal with grief alone. - Kent. It is the stars, - The stars above us, govern our conditions; - Else one self mate and mate could not beget - Such different issues. You spoke not with her since? - Gent. No. - Kent. Was this before the King return'd? - Gent. No, since. - Kent. Well, sir, the poor distressed Lear's i' th' town; - Who sometime, in his better tune, remembers - What we are come about, and by no means - Will yield to see his daughter. - Gent. Why, good sir? - Kent. A sovereign shame so elbows him; his own unkindness, - That stripp'd her from his benediction, turn'd her - To foreign casualties, gave her dear rights - To his dog-hearted daughters- these things string - His mind so venomously that burning shame - Detains him from Cordelia. - Gent. Alack, poor gentleman! - Kent. Of Albany's and Cornwall's powers you heard not? - Gent. 'Tis so; they are afoot. - Kent. Well, sir, I'll bring you to our master Lear - And leave you to attend him. Some dear cause - Will in concealment wrap me up awhile. - When I am known aright, you shall not grieve - Lending me this acquaintance. I pray you go - Along with me. Exeunt. - - - - -Scene IV. -The French camp. - -Enter, with Drum and Colours, Cordelia, Doctor, and Soldiers. - - Cor. Alack, 'tis he! Why, he was met even now - As mad as the vex'd sea, singing aloud, - Crown'd with rank fumiter and furrow weeds, - With hardocks, hemlock, nettles, cuckoo flow'rs, - Darnel, and all the idle weeds that grow - In our sustaining corn. A century send forth. - Search every acre in the high-grown field - And bring him to our eye. [Exit an Officer.] What can man's - wisdom - In the restoring his bereaved sense? - He that helps him take all my outward worth. - Doct. There is means, madam. - Our foster nurse of nature is repose, - The which he lacks. That to provoke in him - Are many simples operative, whose power - Will close the eye of anguish. - Cor. All blest secrets, - All you unpublish'd virtues of the earth, - Spring with my tears! be aidant and remediate - In the good man's distress! Seek, seek for him! - Lest his ungovern'd rage dissolve the life - That wants the means to lead it. - - Enter Messenger. - - Mess. News, madam. - The British pow'rs are marching hitherward. - Cor. 'Tis known before. Our preparation stands - In expectation of them. O dear father, - It is thy business that I go about. - Therefore great France - My mourning and important tears hath pitied. - No blown ambition doth our arms incite, - But love, dear love, and our ag'd father's right. - Soon may I hear and see him! - Exeunt. - - - - -Scene V. -Gloucester's Castle. - -Enter Regan and [Oswald the] Steward. - - Reg. But are my brother's pow'rs set forth? - Osw. Ay, madam. - Reg. Himself in person there? - Osw. Madam, with much ado. - Your sister is the better soldier. - Reg. Lord Edmund spake not with your lord at home? - Osw. No, madam. - Reg. What might import my sister's letter to him? - Osw. I know not, lady. - Reg. Faith, he is posted hence on serious matter. - It was great ignorance, Gloucester's eyes being out, - To let him live. Where he arrives he moves - All hearts against us. Edmund, I think, is gone, - In pity of his misery, to dispatch - His nighted life; moreover, to descry - The strength o' th' enemy. - Osw. I must needs after him, madam, with my letter. - Reg. Our troops set forth to-morrow. Stay with us. - The ways are dangerous. - Osw. I may not, madam. - My lady charg'd my duty in this business. - Reg. Why should she write to Edmund? Might not you - Transport her purposes by word? Belike, - Something- I know not what- I'll love thee much- - Let me unseal the letter. - Osw. Madam, I had rather- - Reg. I know your lady does not love her husband; - I am sure of that; and at her late being here - She gave strange eliads and most speaking looks - To noble Edmund. I know you are of her bosom. - Osw. I, madam? - Reg. I speak in understanding. Y'are! I know't. - Therefore I do advise you take this note. - My lord is dead; Edmund and I have talk'd, - And more convenient is he for my hand - Than for your lady's. You may gather more. - If you do find him, pray you give him this; - And when your mistress hears thus much from you, - I pray desire her call her wisdom to her. - So farewell. - If you do chance to hear of that blind traitor, - Preferment falls on him that cuts him off. - Osw. Would I could meet him, madam! I should show - What party I do follow. - Reg. Fare thee well. Exeunt. - - - - -Scene VI. -The country near Dover. - -Enter Gloucester, and Edgar [like a Peasant]. - - Glou. When shall I come to th' top of that same hill? - Edg. You do climb up it now. Look how we labour. - Glou. Methinks the ground is even. - Edg. Horrible steep. - Hark, do you hear the sea? - Glou. No, truly. - Edg. Why, then, your other senses grow imperfect - By your eyes' anguish. - Glou. So may it be indeed. - Methinks thy voice is alter'd, and thou speak'st - In better phrase and matter than thou didst. - Edg. Y'are much deceiv'd. In nothing am I chang'd - But in my garments. - Glou. Methinks y'are better spoken. - Edg. Come on, sir; here's the place. Stand still. How fearful - And dizzy 'tis to cast one's eyes so low! - The crows and choughs that wing the midway air - Show scarce so gross as beetles. Halfway down - Hangs one that gathers sampire- dreadful trade! - Methinks he seems no bigger than his head. - The fishermen that walk upon the beach - Appear like mice; and yond tall anchoring bark, - Diminish'd to her cock; her cock, a buoy - Almost too small for sight. The murmuring surge - That on th' unnumb'red idle pebble chafes - Cannot be heard so high. I'll look no more, - Lest my brain turn, and the deficient sight - Topple down headlong. - Glou. Set me where you stand. - Edg. Give me your hand. You are now within a foot - Of th' extreme verge. For all beneath the moon - Would I not leap upright. - Glou. Let go my hand. - Here, friend, is another purse; in it a jewel - Well worth a poor man's taking. Fairies and gods - Prosper it with thee! Go thou further off; - Bid me farewell, and let me hear thee going. - Edg. Now fare ye well, good sir. - Glou. With all my heart. - Edg. [aside]. Why I do trifle thus with his despair - Is done to cure it. - Glou. O you mighty gods! He kneels. - This world I do renounce, and, in your sights, - Shake patiently my great affliction off. - If I could bear it longer and not fall - To quarrel with your great opposeless wills, - My snuff and loathed part of nature should - Burn itself out. If Edgar live, O, bless him! - Now, fellow, fare thee well. - He falls [forward and swoons]. - Edg. Gone, sir, farewell.- - And yet I know not how conceit may rob - The treasury of life when life itself - Yields to the theft. Had he been where he thought, - By this had thought been past.- Alive or dead? - Ho you, sir! friend! Hear you, sir? Speak!- - Thus might he pass indeed. Yet he revives. - What are you, sir? - Glou. Away, and let me die. - Edg. Hadst thou been aught but gossamer, feathers, air, - So many fadom down precipitating, - Thou'dst shiver'd like an egg; but thou dost breathe; - Hast heavy substance; bleed'st not; speak'st; art sound. - Ten masts at each make not the altitude - Which thou hast perpendicularly fell. - Thy life is a miracle. Speak yet again. - Glou. But have I fall'n, or no? - Edg. From the dread summit of this chalky bourn. - Look up a-height. The shrill-gorg'd lark so far - Cannot be seen or heard. Do but look up. - Glou. Alack, I have no eyes! - Is wretchedness depriv'd that benefit - To end itself by death? 'Twas yet some comfort - When misery could beguile the tyrant's rage - And frustrate his proud will. - Edg. Give me your arm. - Up- so. How is't? Feel you your legs? You stand. - Glou. Too well, too well. - Edg. This is above all strangeness. - Upon the crown o' th' cliff what thing was that - Which parted from you? - Glou. A poor unfortunate beggar. - Edg. As I stood here below, methought his eyes - Were two full moons; he had a thousand noses, - Horns whelk'd and wav'd like the enridged sea. - It was some fiend. Therefore, thou happy father, - Think that the clearest gods, who make them honours - Of men's impossibility, have preserv'd thee. - Glou. I do remember now. Henceforth I'll bear - Affliction till it do cry out itself - 'Enough, enough,' and die. That thing you speak of, - I took it for a man. Often 'twould say - 'The fiend, the fiend'- he led me to that place. - Edg. Bear free and patient thoughts. - - Enter Lear, mad, [fantastically dressed with weeds]. - - But who comes here? - The safer sense will ne'er accommodate - His master thus. - Lear. No, they cannot touch me for coming; - I am the King himself. - Edg. O thou side-piercing sight! - Lear. Nature 's above art in that respect. There's your press - money. That fellow handles his bow like a crow-keeper. Draw -me - a clothier's yard. Look, look, a mouse! Peace, peace; this -piece - of toasted cheese will do't. There's my gauntlet; I'll prove -it - on a giant. Bring up the brown bills. O, well flown, bird! -i' - th' clout, i' th' clout! Hewgh! Give the word. - Edg. Sweet marjoram. - Lear. Pass. - Glou. I know that voice. - Lear. Ha! Goneril with a white beard? They flatter'd me like a -dog, - and told me I had white hairs in my beard ere the black ones - were there. To say 'ay' and 'no' to everything I said! 'Ay' -and - 'no' too was no good divinity. When the rain came to wet me - once, and the wind to make me chatter; when the thunder -would - not peace at my bidding; there I found 'em, there I smelt -'em - out. Go to, they are not men o' their words! They told me I -was - everything. 'Tis a lie- I am not ague-proof. - Glou. The trick of that voice I do well remember. - Is't not the King? - Lear. Ay, every inch a king! - When I do stare, see how the subject quakes. - I pardon that man's life. What was thy cause? - Adultery? - Thou shalt not die. Die for adultery? No. - The wren goes to't, and the small gilded fly - Does lecher in my sight. - Let copulation thrive; for Gloucester's bastard son - Was kinder to his father than my daughters - Got 'tween the lawful sheets. - To't, luxury, pell-mell! for I lack soldiers. - Behold yond simp'ring dame, - Whose face between her forks presageth snow, - That minces virtue, and does shake the head - To hear of pleasure's name. - The fitchew nor the soiled horse goes to't - With a more riotous appetite. - Down from the waist they are Centaurs, - Though women all above. - But to the girdle do the gods inherit, - Beneath is all the fiend's. - There's hell, there's darkness, there's the sulphurous pit; - burning, scalding, stench, consumption. Fie, fie, fie! pah, -pah! - Give me an ounce of civet, good apothecary, to sweeten my - imagination. There's money for thee. - Glou. O, let me kiss that hand! - Lear. Let me wipe it first; it smells of mortality. - Glou. O ruin'd piece of nature! This great world - Shall so wear out to naught. Dost thou know me? - Lear. I remember thine eyes well enough. Dost thou squiny at -me? - No, do thy worst, blind Cupid! I'll not love. Read thou this - challenge; mark but the penning of it. - Glou. Were all the letters suns, I could not see one. - Edg. [aside] I would not take this from report. It is, - And my heart breaks at it. - Lear. Read. - Glou. What, with the case of eyes? - Lear. O, ho, are you there with me? No eyes in your head, nor -no - money in your purse? Your eyes are in a heavy case, your -purse - in a light. Yet you see how this world goes. - Glou. I see it feelingly. - Lear. What, art mad? A man may see how the world goes with no -eyes. - Look with thine ears. See how yond justice rails upon yond - simple thief. Hark in thine ear. Change places and, -handy-dandy, - which is the justice, which is the thief? Thou hast seen a - farmer's dog bark at a beggar? - Glou. Ay, sir. - Lear. And the creature run from the cur? There thou mightst -behold - the great image of authority: a dog's obeyed in office. - Thou rascal beadle, hold thy bloody hand! - Why dost thou lash that whore? Strip thine own back. - Thou hotly lusts to use her in that kind - For which thou whip'st her. The usurer hangs the cozener. - Through tatter'd clothes small vices do appear; - Robes and furr'd gowns hide all. Plate sin with gold, - And the strong lance of justice hurtless breaks; - Arm it in rags, a pygmy's straw does pierce it. - None does offend, none- I say none! I'll able 'em. - Take that of me, my friend, who have the power - To seal th' accuser's lips. Get thee glass eyes - And, like a scurvy politician, seem - To see the things thou dost not. Now, now, now, now! - Pull off my boots. Harder, harder! So. - Edg. O, matter and impertinency mix'd! - Reason, in madness! - Lear. If thou wilt weep my fortunes, take my eyes. - I know thee well enough; thy name is Gloucester. - Thou must be patient. We came crying hither; - Thou know'st, the first time that we smell the air - We wawl and cry. I will preach to thee. Mark. - Glou. Alack, alack the day! - Lear. When we are born, we cry that we are come - To this great stage of fools. This' a good block. - It were a delicate stratagem to shoe - A troop of horse with felt. I'll put't in proof, - And when I have stol'n upon these sons-in-law, - Then kill, kill, kill, kill, kill, kill! - - Enter a Gentleman [with Attendants]. - - Gent. O, here he is! Lay hand upon him.- Sir, - Your most dear daughter- - Lear. No rescue? What, a prisoner? I am even - The natural fool of fortune. Use me well; - You shall have ransom. Let me have a surgeon; - I am cut to th' brains. - Gent. You shall have anything. - Lear. No seconds? All myself? - Why, this would make a man a man of salt, - To use his eyes for garden waterpots, - Ay, and laying autumn's dust. - Gent. Good sir- - Lear. I will die bravely, like a smug bridegroom. What! - I will be jovial. Come, come, I am a king; - My masters, know you that? - Gent. You are a royal one, and we obey you. - Lear. Then there's life in't. Nay, an you get it, you shall get -it - by running. Sa, sa, sa, sa! - Exit running. [Attendants follow.] - Gent. A sight most pitiful in the meanest wretch, - Past speaking of in a king! Thou hast one daughter - Who redeems nature from the general curse - Which twain have brought her to. - Edg. Hail, gentle sir. - Gent. Sir, speed you. What's your will? - Edg. Do you hear aught, sir, of a battle toward? - Gent. Most sure and vulgar. Every one hears that - Which can distinguish sound. - Edg. But, by your favour, - How near's the other army? - Gent. Near and on speedy foot. The main descry - Stands on the hourly thought. - Edg. I thank you sir. That's all. - Gent. Though that the Queen on special cause is here, - Her army is mov'd on. - Edg. I thank you, sir - Exit [Gentleman]. - Glou. You ever-gentle gods, take my breath from me; - Let not my worse spirit tempt me again - To die before you please! - Edg. Well pray you, father. - Glou. Now, good sir, what are you? - Edg. A most poor man, made tame to fortune's blows, - Who, by the art of known and feeling sorrows, - Am pregnant to good pity. Give me your hand; - I'll lead you to some biding. - Glou. Hearty thanks. - The bounty and the benison of heaven - To boot, and boot! - - Enter [Oswald the] Steward. - - Osw. A proclaim'd prize! Most happy! - That eyeless head of thine was first fram'd flesh - To raise my fortunes. Thou old unhappy traitor, - Briefly thyself remember. The sword is out - That must destroy thee. - Glou. Now let thy friendly hand - Put strength enough to't. - [Edgar interposes.] - Osw. Wherefore, bold peasant, - Dar'st thou support a publish'd traitor? Hence! - Lest that th' infection of his fortune take - Like hold on thee. Let go his arm. - Edg. Chill not let go, zir, without vurther 'cagion. - Osw. Let go, slave, or thou diest! - Edg. Good gentleman, go your gait, and let poor voke pass. An -chud - ha' bin zwagger'd out of my life, 'twould not ha' bin zo -long as - 'tis by a vortnight. Nay, come not near th' old man. Keep -out, - che vore ye, or Ise try whether your costard or my ballow be -the - harder. Chill be plain with you. - Osw. Out, dunghill! - They fight. - Edg. Chill pick your teeth, zir. Come! No matter vor your -foins. - [Oswald falls.] - Osw. Slave, thou hast slain me. Villain, take my purse. - If ever thou wilt thrive, bury my body, - And give the letters which thou find'st about me - To Edmund Earl of Gloucester. Seek him out - Upon the British party. O, untimely death! Death! - He dies. - Edg. I know thee well. A serviceable villain, - As duteous to the vices of thy mistress - As badness would desire. - Glou. What, is he dead? - Edg. Sit you down, father; rest you. - Let's see his pockets; these letters that he speaks of - May be my friends. He's dead. I am only sorry - He had no other deathsman. Let us see. - Leave, gentle wax; and, manners, blame us not. - To know our enemies' minds, we'ld rip their hearts; - Their papers, is more lawful. Reads the letter. - - 'Let our reciprocal vows be rememb'red. You have many - opportunities to cut him off. If your will want not, time -and - place will be fruitfully offer'd. There is nothing done, if -he - return the conqueror. Then am I the prisoner, and his bed my - jail; from the loathed warmth whereof deliver me, and supply -the - place for your labour. - 'Your (wife, so I would say) affectionate servant, - -'Goneril.' - - O indistinguish'd space of woman's will! - A plot upon her virtuous husband's life, - And the exchange my brother! Here in the sands - Thee I'll rake up, the post unsanctified - Of murtherous lechers; and in the mature time - With this ungracious paper strike the sight - Of the death-practis'd Duke, For him 'tis well - That of thy death and business I can tell. - Glou. The King is mad. How stiff is my vile sense, - That I stand up, and have ingenious feeling - Of my huge sorrows! Better I were distract. - So should my thoughts be sever'd from my griefs, - And woes by wrong imaginations lose - The knowledge of themselves. - A drum afar off. - Edg. Give me your hand. - Far off methinks I hear the beaten drum. - Come, father, I'll bestow you with a friend. Exeunt. - - - - -Scene VII. -A tent in the French camp. - -Enter Cordelia, Kent, Doctor, and Gentleman. - - Cor. O thou good Kent, how shall I live and work - To match thy goodness? My life will be too short - And every measure fail me. - Kent. To be acknowledg'd, madam, is o'erpaid. - All my reports go with the modest truth; - Nor more nor clipp'd, but so. - Cor. Be better suited. - These weeds are memories of those worse hours. - I prithee put them off. - Kent. Pardon, dear madam. - Yet to be known shortens my made intent. - My boon I make it that you know me not - Till time and I think meet. - Cor. Then be't so, my good lord. [To the Doctor] How, does the -King? - Doct. Madam, sleeps still. - Cor. O you kind gods, - Cure this great breach in his abused nature! - Th' untun'd and jarring senses, O, wind up - Of this child-changed father! - Doct. So please your Majesty - That we may wake the King? He hath slept long. - Cor. Be govern'd by your knowledge, and proceed - I' th' sway of your own will. Is he array'd? - - Enter Lear in a chair carried by Servants. - - Gent. Ay, madam. In the heaviness of sleep - We put fresh garments on him. - Doct. Be by, good madam, when we do awake him. - I doubt not of his temperance. - Cor. Very well. - Music. - Doct. Please you draw near. Louder the music there! - Cor. O my dear father, restoration hang - Thy medicine on my lips, and let this kiss - Repair those violent harms that my two sisters - Have in thy reverence made! - Kent. Kind and dear princess! - Cor. Had you not been their father, these white flakes - Had challeng'd pity of them. Was this a face - To be oppos'd against the warring winds? - To stand against the deep dread-bolted thunder? - In the most terrible and nimble stroke - Of quick cross lightning? to watch- poor perdu!- - With this thin helm? Mine enemy's dog, - Though he had bit me, should have stood that night - Against my fire; and wast thou fain, poor father, - To hovel thee with swine and rogues forlorn, - In short and musty straw? Alack, alack! - 'Tis wonder that thy life and wits at once - Had not concluded all.- He wakes. Speak to him. - Doct. Madam, do you; 'tis fittest. - Cor. How does my royal lord? How fares your Majesty? - Lear. You do me wrong to take me out o' th' grave. - Thou art a soul in bliss; but I am bound - Upon a wheel of fire, that mine own tears - Do scald like molten lead. - Cor. Sir, do you know me? - Lear. You are a spirit, I know. When did you die? - Cor. Still, still, far wide! - Doct. He's scarce awake. Let him alone awhile. - Lear. Where have I been? Where am I? Fair daylight, - I am mightily abus'd. I should e'en die with pity, - To see another thus. I know not what to say. - I will not swear these are my hands. Let's see. - I feel this pin prick. Would I were assur'd - Of my condition! - Cor. O, look upon me, sir, - And hold your hands in benediction o'er me. - No, sir, you must not kneel. - Lear. Pray, do not mock me. - I am a very foolish fond old man, - Fourscore and upward, not an hour more nor less; - And, to deal plainly, - I fear I am not in my perfect mind. - Methinks I should know you, and know this man; - Yet I am doubtful; for I am mainly ignorant - What place this is; and all the skill I have - Remembers not these garments; nor I know not - Where I did lodge last night. Do not laugh at me; - For (as I am a man) I think this lady - To be my child Cordelia. - Cor. And so I am! I am! - Lear. Be your tears wet? Yes, faith. I pray weep not. - If you have poison for me, I will drink it. - I know you do not love me; for your sisters - Have, as I do remember, done me wrong. - You have some cause, they have not. - Cor. No cause, no cause. - Lear. Am I in France? - Kent. In your own kingdom, sir. - Lear. Do not abuse me. - Doct. Be comforted, good madam. The great rage - You see is kill'd in him; and yet it is danger - To make him even o'er the time he has lost. - Desire him to go in. Trouble him no more - Till further settling. - Cor. Will't please your Highness walk? - Lear. You must bear with me. - Pray you now, forget and forgive. I am old and foolish. - Exeunt. Manent Kent and Gentleman. - Gent. Holds it true, sir, that the Duke of Cornwall was so -slain? - Kent. Most certain, sir. - Gent. Who is conductor of his people? - Kent. As 'tis said, the bastard son of Gloucester. - Gent. They say Edgar, his banish'd son, is with the Earl of -Kent - in Germany. - Kent. Report is changeable. 'Tis time to look about; the powers -of - the kingdom approach apace. - Gent. The arbitrement is like to be bloody. - Fare you well, sir. [Exit.] - Kent. My point and period will be thoroughly wrought, - Or well or ill, as this day's battle's fought. Exit. - - - - -<> - - - -ACT V. Scene I. -The British camp near Dover. - -Enter, with Drum and Colours, Edmund, Regan, Gentleman, and -Soldiers. - - Edm. Know of the Duke if his last purpose hold, - Or whether since he is advis'd by aught - To change the course. He's full of alteration - And self-reproving. Bring his constant pleasure. - [Exit an Officer.] - Reg. Our sister's man is certainly miscarried. - Edm. Tis to be doubted, madam. - Reg. Now, sweet lord, - You know the goodness I intend upon you. - Tell me- but truly- but then speak the truth- - Do you not love my sister? - Edm. In honour'd love. - Reg. But have you never found my brother's way - To the forfended place? - Edm. That thought abuses you. - Reg. I am doubtful that you have been conjunct - And bosom'd with her, as far as we call hers. - Edm. No, by mine honour, madam. - Reg. I never shall endure her. Dear my lord, - Be not familiar with her. - Edm. Fear me not. - She and the Duke her husband! - - Enter, with Drum and Colours, Albany, Goneril, Soldiers. - - Gon. [aside] I had rather lose the battle than that sister - Should loosen him and me. - Alb. Our very loving sister, well bemet. - Sir, this I hear: the King is come to his daughter, - With others whom the rigour of our state - Forc'd to cry out. Where I could not be honest, - I never yet was valiant. For this business, - It toucheth us as France invades our land, - Not bolds the King, with others whom, I fear, - Most just and heavy causes make oppose. - Edm. Sir, you speak nobly. - Reg. Why is this reason'd? - Gon. Combine together 'gainst the enemy; - For these domestic and particular broils - Are not the question here. - Alb. Let's then determine - With th' ancient of war on our proceeding. - Edm. I shall attend you presently at your tent. - Reg. Sister, you'll go with us? - Gon. No. - Reg. 'Tis most convenient. Pray you go with us. - Gon. [aside] O, ho, I know the riddle.- I will go. - - [As they are going out,] enter Edgar [disguised]. - - Edg. If e'er your Grace had speech with man so poor, - Hear me one word. - Alb. I'll overtake you.- Speak. - Exeunt [all but Albany and Edgar]. - Edg. Before you fight the battle, ope this letter. - If you have victory, let the trumpet sound - For him that brought it. Wretched though I seem, - I can produce a champion that will prove - What is avouched there. If you miscarry, - Your business of the world hath so an end, - And machination ceases. Fortune love you! - Alb. Stay till I have read the letter. - Edg. I was forbid it. - When time shall serve, let but the herald cry, - And I'll appear again. - Alb. Why, fare thee well. I will o'erlook thy paper. - Exit [Edgar]. - - Enter Edmund. - - Edm. The enemy 's in view; draw up your powers. - Here is the guess of their true strength and forces - By diligent discovery; but your haste - Is now urg'd on you. - Alb. We will greet the time. Exit. - Edm. To both these sisters have I sworn my love; - Each jealous of the other, as the stung - Are of the adder. Which of them shall I take? - Both? one? or neither? Neither can be enjoy'd, - If both remain alive. To take the widow - Exasperates, makes mad her sister Goneril; - And hardly shall I carry out my side, - Her husband being alive. Now then, we'll use - His countenance for the battle, which being done, - Let her who would be rid of him devise - His speedy taking off. As for the mercy - Which he intends to Lear and to Cordelia- - The battle done, and they within our power, - Shall never see his pardon; for my state - Stands on me to defend, not to debate. Exit. - - - - -Scene II. -A field between the two camps. - -Alarum within. Enter, with Drum and Colours, the Powers of France -over the stage, Cordelia with her Father in her hand, and exeunt. - -Enter Edgar and Gloucester. - - Edg. Here, father, take the shadow of this tree - For your good host. Pray that the right may thrive. - If ever I return to you again, - I'll bring you comfort. - Glou. Grace go with you, sir! - Exit [Edgar]. - - Alarum and retreat within. Enter Edgar, - - Edg. Away, old man! give me thy hand! away! - King Lear hath lost, he and his daughter ta'en. - Give me thy hand! come on! - Glou. No further, sir. A man may rot even here. - Edg. What, in ill thoughts again? Men must endure - Their going hence, even as their coming hither; - Ripeness is all. Come on. - Glou. And that's true too. Exeunt. - - - - -Scene III. -The British camp, near Dover. - -Enter, in conquest, with Drum and Colours, Edmund; Lear and -Cordelia -as prisoners; Soldiers, Captain. - - Edm. Some officers take them away. Good guard - Until their greater pleasures first be known - That are to censure them. - Cor. We are not the first - Who with best meaning have incurr'd the worst. - For thee, oppressed king, am I cast down; - Myself could else outfrown false Fortune's frown. - Shall we not see these daughters and these sisters? - Lear. No, no, no, no! Come, let's away to prison. - We two alone will sing like birds i' th' cage. - When thou dost ask me blessing, I'll kneel down - And ask of thee forgiveness. So we'll live, - And pray, and sing, and tell old tales, and laugh - At gilded butterflies, and hear poor rogues - Talk of court news; and we'll talk with them too- - Who loses and who wins; who's in, who's out- - And take upon 's the mystery of things, - As if we were God's spies; and we'll wear out, - In a wall'd prison, packs and sects of great ones - That ebb and flow by th' moon. - Edm. Take them away. - Lear. Upon such sacrifices, my Cordelia, - The gods themselves throw incense. Have I caught thee? - He that parts us shall bring a brand from heaven - And fire us hence like foxes. Wipe thine eyes. - The goodyears shall devour 'em, flesh and fell, - Ere they shall make us weep! We'll see 'em starv'd first. - Come. Exeunt [Lear and Cordelia, guarded]. - Edm. Come hither, Captain; hark. - Take thou this note [gives a paper]. Go follow them to -prison. - One step I have advanc'd thee. If thou dost - As this instructs thee, thou dost make thy way - To noble fortunes. Know thou this, that men - Are as the time is. To be tender-minded - Does not become a sword. Thy great employment - Will not bear question. Either say thou'lt do't, - Or thrive by other means. - Capt. I'll do't, my lord. - Edm. About it! and write happy when th' hast done. - Mark- I say, instantly; and carry it so - As I have set it down. - Capt. I cannot draw a cart, nor eat dried oats; - If it be man's work, I'll do't. Exit. - - Flourish. Enter Albany, Goneril, Regan, Soldiers. - - Alb. Sir, you have show'd to-day your valiant strain, - And fortune led you well. You have the captives - Who were the opposites of this day's strife. - We do require them of you, so to use them - As we shall find their merits and our safety - May equally determine. - Edm. Sir, I thought it fit - To send the old and miserable King - To some retention and appointed guard; - Whose age has charms in it, whose title more, - To pluck the common bosom on his side - And turn our impress'd lances in our eyes - Which do command them. With him I sent the Queen, - My reason all the same; and they are ready - To-morrow, or at further space, t' appear - Where you shall hold your session. At this time - We sweat and bleed: the friend hath lost his friend; - And the best quarrels, in the heat, are curs'd - By those that feel their sharpness. - The question of Cordelia and her father - Requires a fitter place. - Alb. Sir, by your patience, - I hold you but a subject of this war, - Not as a brother. - Reg. That's as we list to grace him. - Methinks our pleasure might have been demanded - Ere you had spoke so far. He led our powers, - Bore the commission of my place and person, - The which immediacy may well stand up - And call itself your brother. - Gon. Not so hot! - In his own grace he doth exalt himself - More than in your addition. - Reg. In my rights - By me invested, he compeers the best. - Gon. That were the most if he should husband you. - Reg. Jesters do oft prove prophets. - Gon. Holla, holla! - That eye that told you so look'd but asquint. - Reg. Lady, I am not well; else I should answer - From a full-flowing stomach. General, - Take thou my soldiers, prisoners, patrimony; - Dispose of them, of me; the walls are thine. - Witness the world that I create thee here - My lord and master. - Gon. Mean you to enjoy him? - Alb. The let-alone lies not in your good will. - Edm. Nor in thine, lord. - Alb. Half-blooded fellow, yes. - Reg. [to Edmund] Let the drum strike, and prove my title thine. - - Alb. Stay yet; hear reason. Edmund, I arrest thee - On capital treason; and, in thine attaint, - This gilded serpent [points to Goneril]. For your claim, -fair - sister, - I bar it in the interest of my wife. - 'Tis she is subcontracted to this lord, - And I, her husband, contradict your banes. - If you will marry, make your loves to me; - My lady is bespoke. - Gon. An interlude! - Alb. Thou art arm'd, Gloucester. Let the trumpet sound. - If none appear to prove upon thy person - Thy heinous, manifest, and many treasons, - There is my pledge [throws down a glove]! I'll prove it on -thy - heart, - Ere I taste bread, thou art in nothing less - Than I have here proclaim'd thee. - Reg. Sick, O, sick! - Gon. [aside] If not, I'll ne'er trust medicine. - Edm. There's my exchange [throws down a glove]. What in the -world - he is - That names me traitor, villain-like he lies. - Call by thy trumpet. He that dares approach, - On him, on you, who not? I will maintain - My truth and honour firmly. - Alb. A herald, ho! - Edm. A herald, ho, a herald! - Alb. Trust to thy single virtue; for thy soldiers, - All levied in my name, have in my name - Took their discharge. - Reg. My sickness grows upon me. - Alb. She is not well. Convey her to my tent. - [Exit Regan, led.] - - Enter a Herald. - - Come hither, herald. Let the trumpet sound, - And read out this. - Capt. Sound, trumpet! A trumpet sounds. - - Her. (reads) 'If any man of quality or degree within the lists -of - the army will maintain upon Edmund, supposed Earl of -Gloucester, - that he is a manifold traitor, let him appear by the third -sound - of the trumpet. He is bold in his defence.' - - Edm. Sound! First trumpet. - Her. Again! Second trumpet. - Her. Again! Third trumpet. - Trumpet answers within. - - Enter Edgar, armed, at the third sound, a Trumpet before him. - - Alb. Ask him his purposes, why he appears - Upon this call o' th' trumpet. - Her. What are you? - Your name, your quality? and why you answer - This present summons? - Edg. Know my name is lost; - By treason's tooth bare-gnawn and canker-bit. - Yet am I noble as the adversary - I come to cope. - Alb. Which is that adversary? - Edg. What's he that speaks for Edmund Earl of Gloucester? - Edm. Himself. What say'st thou to him? - Edg. Draw thy sword, - That, if my speech offend a noble heart, - Thy arm may do thee justice. Here is mine. - Behold, it is the privilege of mine honours, - My oath, and my profession. I protest- - Maugre thy strength, youth, place, and eminence, - Despite thy victor sword and fire-new fortune, - Thy valour and thy heart- thou art a traitor; - False to thy gods, thy brother, and thy father; - Conspirant 'gainst this high illustrious prince; - And from th' extremest upward of thy head - To the descent and dust beneath thy foot, - A most toad-spotted traitor. Say thou 'no,' - This sword, this arm, and my best spirits are bent - To prove upon thy heart, whereto I speak, - Thou liest. - Edm. In wisdom I should ask thy name; - But since thy outside looks so fair and warlike, - And that thy tongue some say of breeding breathes, - What safe and nicely I might well delay - By rule of knighthood, I disdain and spurn. - Back do I toss those treasons to thy head; - With the hell-hated lie o'erwhelm thy heart; - Which- for they yet glance by and scarcely bruise- - This sword of mine shall give them instant way - Where they shall rest for ever. Trumpets, speak! - Alarums. Fight. [Edmund falls.] - Alb. Save him, save him! - Gon. This is mere practice, Gloucester. - By th' law of arms thou wast not bound to answer - An unknown opposite. Thou art not vanquish'd, - But cozen'd and beguil'd. - Alb. Shut your mouth, dame, - Or with this paper shall I stop it. [Shows her letter to - Edmund.]- [To Edmund]. Hold, sir. - [To Goneril] Thou worse than any name, read thine own evil. - No tearing, lady! I perceive you know it. - Gon. Say if I do- the laws are mine, not thine. - Who can arraign me for't? - Alb. Most monstrous! - Know'st thou this paper? - Gon. Ask me not what I know. Exit. - Alb. Go after her. She's desperate; govern her. - [Exit an Officer.] - Edm. What, you have charg'd me with, that have I done, - And more, much more. The time will bring it out. - 'Tis past, and so am I.- But what art thou - That hast this fortune on me? If thou'rt noble, - I do forgive thee. - Edg. Let's exchange charity. - I am no less in blood than thou art, Edmund; - If more, the more th' hast wrong'd me. - My name is Edgar and thy father's son. - The gods are just, and of our pleasant vices - Make instruments to scourge us. - The dark and vicious place where thee he got - Cost him his eyes. - Edm. Th' hast spoken right; 'tis true. - The wheel is come full circle; I am here. - Alb. Methought thy very gait did prophesy - A royal nobleness. I must embrace thee. - Let sorrow split my heart if ever I - Did hate thee, or thy father! - Edg. Worthy prince, I know't. - Alb. Where have you hid yourself? - How have you known the miseries of your father? - Edg. By nursing them, my lord. List a brief tale; - And when 'tis told, O that my heart would burst! - The bloody proclamation to escape - That follow'd me so near (O, our lives' sweetness! - That with the pain of death would hourly die - Rather than die at once!) taught me to shift - Into a madman's rags, t' assume a semblance - That very dogs disdain'd; and in this habit - Met I my father with his bleeding rings, - Their precious stones new lost; became his guide, - Led him, begg'd for him, sav'd him from despair; - Never (O fault!) reveal'd myself unto him - Until some half hour past, when I was arm'd, - Not sure, though hoping of this good success, - I ask'd his blessing, and from first to last - Told him my pilgrimage. But his flaw'd heart - (Alack, too weak the conflict to support!) - 'Twixt two extremes of passion, joy and grief, - Burst smilingly. - Edm. This speech of yours hath mov'd me, - And shall perchance do good; but speak you on; - You look as you had something more to say. - Alb. If there be more, more woful, hold it in; - For I am almost ready to dissolve, - Hearing of this. - Edg. This would have seem'd a period - To such as love not sorrow; but another, - To amplify too much, would make much more, - And top extremity. - Whilst I was big in clamour, came there a man, - Who, having seen me in my worst estate, - Shunn'd my abhorr'd society; but then, finding - Who 'twas that so endur'd, with his strong arms - He fastened on my neck, and bellowed out - As he'd burst heaven; threw him on my father; - Told the most piteous tale of Lear and him - That ever ear receiv'd; which in recounting - His grief grew puissant, and the strings of life - Began to crack. Twice then the trumpets sounded, - And there I left him tranc'd. - Alb. But who was this? - Edg. Kent, sir, the banish'd Kent; who in disguise - Followed his enemy king and did him service - Improper for a slave. - - Enter a Gentleman with a bloody knife. - - Gent. Help, help! O, help! - Edg. What kind of help? - Alb. Speak, man. - Edg. What means that bloody knife? - Gent. 'Tis hot, it smokes. - It came even from the heart of- O! she's dead! - Alb. Who dead? Speak, man. - Gent. Your lady, sir, your lady! and her sister - By her is poisoned; she hath confess'd it. - Edm. I was contracted to them both. All three - Now marry in an instant. - - Enter Kent. - - Edg. Here comes Kent. - Alb. Produce their bodies, be they alive or dead. - [Exit Gentleman.] - This judgement of the heavens, that makes us tremble - Touches us not with pity. O, is this he? - The time will not allow the compliment - That very manners urges. - Kent. I am come - To bid my king and master aye good night. - Is he not here? - Alb. Great thing of us forgot! - Speak, Edmund, where's the King? and where's Cordelia? - The bodies of Goneril and Regan are brought in. - Seest thou this object, Kent? - Kent. Alack, why thus? - Edm. Yet Edmund was belov'd. - The one the other poisoned for my sake, - And after slew herself. - Alb. Even so. Cover their faces. - Edm. I pant for life. Some good I mean to do, - Despite of mine own nature. Quickly send - (Be brief in't) to the castle; for my writ - Is on the life of Lear and on Cordelia. - Nay, send in time. - Alb. Run, run, O, run! - Edg. To who, my lord? Who has the office? Send - Thy token of reprieve. - Edm. Well thought on. Take my sword; - Give it the Captain. - Alb. Haste thee for thy life. [Exit Edgar.] - Edm. He hath commission from thy wife and me - To hang Cordelia in the prison and - To lay the blame upon her own despair - That she fordid herself. - Alb. The gods defend her! Bear him hence awhile. - [Edmund is borne off.] - - Enter Lear, with Cordelia [dead] in his arms, [Edgar, -Captain, - and others following]. - - Lear. Howl, howl, howl, howl! O, you are men of stone. - Had I your tongues and eyes, I'ld use them so - That heaven's vault should crack. She's gone for ever! - I know when one is dead, and when one lives. - She's dead as earth. Lend me a looking glass. - If that her breath will mist or stain the stone, - Why, then she lives. - Kent. Is this the promis'd end? - Edg. Or image of that horror? - Alb. Fall and cease! - Lear. This feather stirs; she lives! If it be so, - It is a chance which does redeem all sorrows - That ever I have felt. - Kent. O my good master! - Lear. Prithee away! - Edg. 'Tis noble Kent, your friend. - Lear. A plague upon you, murderers, traitors all! - I might have sav'd her; now she's gone for ever! - Cordelia, Cordelia! stay a little. Ha! - What is't thou say'st, Her voice was ever soft, - Gentle, and low- an excellent thing in woman. - I kill'd the slave that was a-hanging thee. - Capt. 'Tis true, my lords, he did. - Lear. Did I not, fellow? - I have seen the day, with my good biting falchion - I would have made them skip. I am old now, - And these same crosses spoil me. Who are you? - Mine eyes are not o' th' best. I'll tell you straight. - Kent. If fortune brag of two she lov'd and hated, - One of them we behold. - Lear. This' a dull sight. Are you not Kent? - Kent. The same- - Your servant Kent. Where is your servant Caius? - Lear. He's a good fellow, I can tell you that. - He'll strike, and quickly too. He's dead and rotten. - Kent. No, my good lord; I am the very man- - Lear. I'll see that straight. - Kent. That from your first of difference and decay - Have followed your sad steps. - Lear. You're welcome hither. - Kent. Nor no man else! All's cheerless, dark, and deadly. - Your eldest daughters have fordone themselves, - And desperately are dead. - Lear. Ay, so I think. - Alb. He knows not what he says; and vain is it - That we present us to him. - Edg. Very bootless. - - Enter a Captain. - - Capt. Edmund is dead, my lord. - Alb. That's but a trifle here. - You lords and noble friends, know our intent. - What comfort to this great decay may come - Shall be applied. For us, we will resign, - During the life of this old Majesty, - To him our absolute power; [to Edgar and Kent] you to your - rights; - With boot, and Such addition as your honours - Have more than merited.- All friends shall taste - The wages of their virtue, and all foes - The cup of their deservings.- O, see, see! - Lear. And my poor fool is hang'd! No, no, no life! - Why should a dog, a horse, a rat, have life, - And thou no breath at all? Thou'lt come no more, - Never, never, never, never, never! - Pray you undo this button. Thank you, sir. - Do you see this? Look on her! look! her lips! - Look there, look there! He dies. - Edg. He faints! My lord, my lord! - Kent. Break, heart; I prithee break! - Edg. Look up, my lord. - Kent. Vex not his ghost. O, let him pass! He hates him - That would upon the rack of this tough world - Stretch him out longer. - Edg. He is gone indeed. - Kent. The wonder is, he hath endur'd so long. - He but usurp'd his life. - Alb. Bear them from hence. Our present business - Is general woe. [To Kent and Edgar] Friends of my soul, you - twain - Rule in this realm, and the gor'd state sustain. - Kent. I have a journey, sir, shortly to go. - My master calls me; I must not say no. - Alb. The weight of this sad time we must obey, - Speak what we feel, not what we ought to say. - The oldest have borne most; we that are young - Shall never see so much, nor live so long. - Exeunt with a dead march. - - -THE END diff --git a/tests/system/providers/google/cloud/datapipelines/resources/word-count.json b/tests/system/providers/google/cloud/datapipelines/resources/word-count.json deleted file mode 100644 index da044ddd6356c..0000000000000 --- a/tests/system/providers/google/cloud/datapipelines/resources/word-count.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "defaultEnvironment": {}, - "image": "gcr.io/dataflow-interns/wordcount-template:latest", - "metadata": { - "description": "An example pipeline that counts words in the input file.", - "name": "Word Count", - "parameters": [ - { - "helpText": "Path of the file pattern glob to read from - for example, gs://dataflow-samples/shakespeare/kinglear.txt", - "label": "Input Cloud Storage file(s)", - "name": "inputFile", - "regexes": [ - "^gs:\\/\\/[^\\n\\r]+$" - ] - }, - { - "helpText": "Path and filename prefix for writing output files - for example, gs://MyBucket/counts", - "label": "Output Cloud Storage file(s)", - "name": "output", - "regexes": [ - "^gs:\\/\\/[^\\n\\r]+$" - ] - } - ] - }, - "sdkInfo": { - "language": "JAVA" - } -}